How to find the maximum value by comparing 2 cells?

3 次查看(过去 30 天)
I have 2 cells array, for example
A = {2,4,5};
B = {1,10};
How can I find the max value (10, in this case) by comapring cell A and B?

采纳的回答

Star Strider
Star Strider 2022-9-22
This is not as efficient as I would like it to be, however it works —
A = {2,4,5};
B = {1,10};
MaxC = max(cellfun(@(x)max([x{:}]),{A,B}))
MaxC = 10
.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

标签

产品


版本

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by