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

조회 수: 44 (최근 30일)
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 CenterFile Exchange에서 Structures에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by