how to find maximum values of two numbers present in a structure

55 ビュー (過去 30 日間)
Sivakumaran Chandrasekaran
Sivakumaran Chandrasekaran 2013 年 12 月 21 日
コメント済み: Walter Roberson 2013 年 12 月 21 日
My code creates a structure with values {15 8}... i need to find the maximum of those two numbers.. how to do it

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 12 月 21 日
編集済み: Azzi Abdelmalek 2013 年 12 月 21 日
data=struct('a',{8 5}) % Example
out=max([data.a])
  1 件のコメント
Walter Roberson
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 ExchangeStructures についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by