how to find maximum values of two numbers present in a structure
16 次查看(过去 30 天)
显示 更早的评论
My code creates a structure with values {15 8}... i need to find the maximum of those two numbers.. how to do it
0 个评论
采纳的回答
Azzi Abdelmalek
2013-12-21
编辑:Azzi Abdelmalek
2013-12-21
data=struct('a',{8 5}) % Example
out=max([data.a])
1 个评论
Walter Roberson
2013-12-21
The above is correct and is for a structure array in which the field "a" of each element has one or more values; the number of values along the rows can vary with the above code, but the number of rows must be consistent with that code.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Structures 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!