How to find the maximum value among values less than a certain value?
46 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(2 个)
madhan ravi
2018-11-19
idx = matrix < 100; %100 is your certain value
%Numbers greater than 100
idx = matrix > 100;
0 个评论
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'));
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrices and Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!