
Finding the indices of the maximum of a matrix for plotting
11 ビュー (過去 30 日間)
古いコメントを表示
Hello, I'm trying to find the indicies of the maximum value of this matrix.
When I use the auto-index finder that's built into the 'max' function, it doesn't correspond to the maximum value of the matrix when plotted.
How do I find the indicies that correspond to the maximum value of m (when plotted)?
Any help is much appreciated.
clear;clc
load('x.mat')
load('y.mat')
load('m.mat')
figure
imagesc(x,y,m)
hold on
set(gca,'YDir','normal')
[maxval,maxidxX] = max(max(m,[],1));
[~,maxidxY] = max(max(m,[],2));
plot(x(maxidxX),y(maxidxY),'w*')
0 件のコメント
採用された回答
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Color and Styling についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!