Read the coordinates as a string, then do the conversions:
prompt = 'Input coordinates between which you want to find the great circle distance (XN, XW XN, XW): ';
getridof = ["N","W",","];
xc = input(prompt, 's')
xc = split(replace(xc,getridof," "));
x = str2double(xc)
a = acos(sin(x(1))*sin(x(3))+cos(x(1))*cos(x(3))*cos(abs(x(2))-x(4)));
d = a*.6371;
disp(['The great circle distance in km is: ',num2str(d)])
This works, and with your desired inputds, produces:
The great circle distance in km is: 0.93002
when I run it.
