0
嗨,有人可以帮助我在这里的matlab命令。我必须确定使用文件中的矩阵数据绘制的填充轮廓中的最高点。然后我必须用红色'x'标记最高点。绘制填充轮廓中的最高点
load('0101862_mod.dtm') % loading the dtm file
X = X0101862_mod(1:81,:) % we name X0101862, it is the location where the data X, Y and Z is stored
Y = X0101862_mod(82:162,:)
Z = X0101862_mod (163:243,:)
figure (1)
subplot(2,2,3)
[C,h] = contourf(X,Y,Z,10);
xlabel('x'); ylabel('y'); zlabel('z'); title('X0101862_mod');
view(-73,34); axis equal; colormap summer; colorbar;
我知道它涉及'最大'命令。当我使用最大值时保持错误。
这是正确的吗? xMax = max(X); yMax = max(Y); (xMax,yMax,'xr'); – user391967 2010-08-01 13:33:49
编号xMax是对应于最大Z的X.'[zMax,maxIdx] = max(Z);'在'maxIdx'中返回数据向量中'Z'最高的位置。例如,如果它是Z中第5个元素最高,那么'maxIdx'将是5.相应地,xMax将是'X'的第5个元素,yMax是'Y'的第5个元素。 – Jonas 2010-08-01 15:24:48