How to find the maximum value among values less than a certain value?

49 ビュー (過去 30 日間)
Jae Min Lee
Jae Min Lee 2018 年 11 月 19 日
編集済み: Andrei Bobrov 2018 年 11 月 19 日
I have a 10x10 cell maxtrix.
[maximumValue, index] = max([cell_matrix{:}]);
I found the max value using the above code.
But I want to find the maximum value of any value below a certain value, but I do not know what to do.

回答 (2 件)

madhan ravi
madhan ravi 2018 年 11 月 19 日
idx = matrix < 100; %100 is your certain value
%Numbers greater than 100
idx = matrix > 100;

Andrei Bobrov
Andrei Bobrov 2018 年 11 月 19 日
編集済み: Andrei Bobrov 2018 年 11 月 19 日
A = cellfun(@(x)x(:),your_cell_array),'un',0);
A = sort(cat(1,A{:}));
out = A(find(A < certain_value,1,'last'));

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by