In this paper, a compact 2×4 microstrip antenna (MSA) array is presented and the effect of inserting shorting wall is optimized with the help of artificial neural network (ANN). An ANN model has been developed for predicting the resonant frequencies with the variation of the height of substrate and shorting wall position. For validation of ANN output, a prototype of 2×4 MSA array is physically fabricated and tested. This validation verifies the proposed antenna for which simulated and ANN results are approximately similar. DOI: http://dx.doi.org/10.11591/telkomnika.v13i3.7089