MATLAB: How to just select a few varaibles using regexp


flag = 'KLAX 312353Z 27009KT 10SM FEW200 18/10 A3007 RMK AO2 SLP182 T01780100 10217 20178 55007'
METAR changes the amount of variables usually when reported I was hoping to get someone thought on how to do this using regexp.
I was thinking about using the regexp to find A3007. I know there are other ways, but I would like to learn how to use regexp.
This is what I have so far regexp(flag, A\4[0123456789]).

Best Answer

  • regexp(flag, 'A\d{4}', 'match')