Finding global maxima and minima of a matrix row

조회 수: 5 (최근 30일)
NotA_Programmer
NotA_Programmer 2022년 5월 3일
편집: NotA_Programmer 2022년 5월 12일
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

답변 (1개)

Star Strider
Star Strider 2022년 5월 3일
This can be done easilly with the max and min functions. For the dimension argument use 'all'.

카테고리

Help CenterFile Exchange에서 Design, Analysis, Benchmarking, and Verification에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by