Extract two floating point numbers from a string
This should be easy, but I have no experience with MATLAB regexp or pattern and can’t adapt the other answers about extracting numbers from a mixed string.
I want to get the latitude and longitude as floating point numbers from a string that looks like this:
23.047°S 67.782°W
The numbers will have 1-3 characters before the decimal point. An "S" or a "W" will produce a negative number.
Suggestions welcome.This should be easy, but I have no experience with MATLAB regexp or pattern and can’t adapt the other answers about extracting numbers from a mixed string.
I want to get the latitude and longitude as floating point numbers from a string that looks like this:
23.047°S 67.782°W
The numbers will have 1-3 characters before the decimal point. An "S" or a "W" will produce a negative number.
Suggestions welcome. This should be easy, but I have no experience with MATLAB regexp or pattern and can’t adapt the other answers about extracting numbers from a mixed string.
I want to get the latitude and longitude as floating point numbers from a string that looks like this:
23.047°S 67.782°W
The numbers will have 1-3 characters before the decimal point. An "S" or a "W" will produce a negative number.
Suggestions welcome. string MATLAB Answers — New Questions