how do i resolve the error Index exceeds matrix dimensions
Show older comments
prompt=('Enter your reponse:1=geodetic to cartesian 2=cartesian to geodetic');
x1=input(prompt);
if x1==1
prompt('enter the lattitude');
phi=input(prompt);
prompt('enter the longitude');
lambda=input(prompt);
prompt('enter the height');
h=input(prompt);
%using WGS84 parameters
a=6378137;
b=6356752.314245;
e=(1-((b/a)^2))^0.5;
N=a/((1-((e^2)*((sin(phi))^2)))^0.5);
x=(N+h)*cos(phi)*cos(lambda);
y=(N+h)*cos(phi)*sin(lambda);
z=((N*(1-(e^2)))+h)*sin(phi);
Accepted Answer
More Answers (0)
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!