Finding global maxima and minima of a matrix row
5 次查看(过去 30 天)
显示 更早的评论
I have a matrix of Data, have calculated its local maxima and minim. Now need help on how to find global maxima and minima of Data.
Code used to find local maxima and minima:
filename = 'xyz.xlsx';
Data = xlsread(xyz);
DataMax = cell(rows,1); IDataMax = cell(rows,1); DataMin = cell(rows,1); IDataMin = cell(rows,1);
for i=1:rows
[DataMax{i}, IDataMax{i}, DataMin{i}, IDataMin{i}] = extrema(Data(i,:));
end
0 个评论
回答(1 个)
Star Strider
2022-5-3
This can be done easilly with the max and min functions. For the dimension argument use 'all'.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Design, Analysis, Benchmarking, and Verification 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!