I have X, Y and Z variables in matrix form, each of size n x 1. Eg.:
X = [-38.0400, -38.6700, -38.9300, -39.4500...]
Whenever I run the code below:
% find center of X
minx = find(X==min(min(X)));
maxx = find(X==max(max(X)));
centx = (minx + maxx) / 2;
xy = Y(centx);
xz = Z(centx);
centx = [centx xy xz];
I'll get the initial answer as, for example:
centx = 6.6034e+04
but then an error will be displayed:
Subscript indices must either be real positive integers or logicals.
Error in max_point(line 5)
xy = Y(centx);
My questions are
- Is the answer given in scientific notation (exponential form) because of the trailing zeros in my original entries?
- How can I avoid getting the answer in scientific notation (exponential form) (because I think that is the cause for the error)?
Thanks in advance