Presently optimization of patch antennas are performed using available softwares like Cs microwave studio, HFSS, IE3D. in this communication a new approach is considered, where source code of the structure and optimization method, both in MATLAB are used and linked to each other. The paper aims for assessment of choosing a suitable patch between circular and rectangular patch for a particular frequency of operation which can be extended for a frequency range. It considers both design parameters like area, height of substrate, dielectric constant of substrate and performance parameters such as directivity, half power beam width in Eplane (EHPBW) and H-plane (HHPBW), reflection co-efficient, VSWR and return loss. The patches are optimized using Particle Swarm Optimization (PSO) and their results are compared in order to decide the best patch. Index Terms-Directivity, EHPBW, HHPBW, Microstrip patch antenna, PSO, MATLAB.