I'm relatively new to coding and I was trying to apply a formula to a MATRIX to get relief angle.
Now A is a 10000 x 2 matrix and I want to apply the following formula to it, everytime I try to do so I recieve and Error "Index in position 1 is invalid. Array indices must be positive integers or logical values".
Error in Untitled (line 4)
Y=abs(atan((A(i-1,2)-A(i,2)/2000)));
A=Profiles(:,[1 2]);for i = 1:10;Y=abs(atan((A(i-1,2)-A(i,2)/2000)));i=i+1;end
Best Answer