找到最大的数字矩阵的位置
1视图(30天)
显示旧的评论
你好,
我想找到一个矩阵的最大数量,还发现它的位置。
clc;%清除命令窗口。
关闭所有;%关闭所有数据(除了imtool。)
imtool关闭所有;%关闭所有imtool数字图像处理工具箱。
清晰;%擦掉所有现有的变量。或者clearvars如果你想要的。
工作空间;
RGB = imread (“IMG_0331.JPG”);%就形象
I = rgb2gray (RGB);
[Gmag, Gdir] = imgradient(我);
% MAX = MAX (abs(我(:)));
% MAX = MAX (abs (Gdir (:)));
M = max([],我“所有”);
[maxValue, linearIndexesOfMaxes] = max(我(:));
% (rowsOfMaxes colsOfMaxes] =找到(我= = maxValue);
这是我的代码。我试着在这里但它工作不像我希望它工作。