Electrocardiogram (ECG) is a non-invasive and economical diagnostic tool for detecting myocardial infarction (MI). The occurrence of a heart attack causes distortions in the ECG waves. This article extracts morphological features from ECG signals to detect and localize MI. After preprocessing the ECG signal, its fiducial points are identified. Then morphological features such as the amplitude, interval, and angle between waves are extracted. A random forest classifier with 100 trees has been used for classification and feature selection. The method was evaluated using the PTB dataset, containing 52 healthy and 148 MI subjects. We tried to diagnose and localize MI in two schemes: interpatient and intrapatient. In this method, we obtained superior results with an accuracy of 80.98%, a sensitivity of 80.98%, a specificity of 96.32%, a positive predictive value of 79.72%, and an F-score of 79.53% for MI localization in the interpatient scheme compared to the state-of-the-art. Our model achieves an accuracy of 96.54%, a sensitivity of 99.74%, a positive predictive value of 96.09%, and an F-score of 97.88% in the interpatient scheme detection. In the interpatient domain, 96.68% accuracy was obtained using only 6 chest leads for detection. The proposed method is interpretable with low computational complexity and applies a new package of morphological features. Compared to recent studies, in this study, the results have been improved in the interpatient scheme which has more vital clinical significance.