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);
MATLAB: How do i resolve the error Index exceeds matrix dimensions
errorMATLAB
Related Question
- Index exceeds the number of array elements (0).
- How do i plot a cell array fi{i} where every cell contains 1*1 matrix
- Help me with Input from keyboard
- I am having trouble receiving user input in the following code. The code works alright if I enter the values. It just goes into a loop asking the same questions and the code doesn’t seem to input the entered values.
- What is the error? Undefined function or variable ‘x’.
Best Answer