我有矩阵形式的 X、Y 和 Z 变量,每个变量的大小为 nx 1。例如:
X = [-38.0400, -38.6700, -38.9300, -39.4500...]
每当我运行以下代码时:
% 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];
我会得到最初的答案,例如:
centx = 6.6034e+04
但随后会显示错误:
Subscript indices must either be real positive integers or logicals.
Error in max_point(line 5)
xy = Y(centx);
我的问题是
- 由于原始条目中的尾随零,答案是否以科学记数法(指数形式)给出?
- 我怎样才能避免以科学记数法(指数形式)得到答案(因为我认为这是错误的原因)?
提前致谢