how to select a set which has a highest value when compared with other sets
2 次查看(过去 30 天)
显示 更早的评论
If we have 4 sets as shown below
A = [ 23 45 67 89 36]
B= [ 32 56 44 47 33 66]
C= [ 12 45 76 99 50 76]
D= [ 19 67 89 37 19 36]
I have to select that set which has the highest value
From the above sets set C has the highest value among all other values which is 99
Then my required set is C.
Can I get a code for selecting such kind of set for different values?
thanks
0 个评论
回答(1 个)
Stephen23
2019-10-24
>> Z = {[23,45,67,89,36],[32,56,44,47,33,66],[12,45,76,99,50,76],[19,67,89,37,19,36]};
>> [~,X] = max(cellfun(@max,Z));
>> V = Z{X}
V =
12 45 76 99 50 76
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!