In MATLAB I have a 1 X 20 column vector of string data in a file name A.txt.
%Input in A.txt:
60N
61N
50S
51S
Objective: to read the column of data as integers and represent N
as positive and S as negative.
So the output would be:
60
61
-50
-51
I have researched other posts, apply str2num double. I’m totally stuck.
Assuming your data is composed like in your example, you can try this: