Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: max in the structure
Replies: 3   Last Post: Dec 11, 2012 10:05 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Nasser Abbasi

Posts: 5,694
Registered: 2/7/05
Re: max in the structure
Posted: Dec 11, 2012 10:05 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 12/11/2012 8:34 AM, Debora wrote:
> Il giorno martedì 11 dicembre 2012 14:44:30 UTC+1, Debora ha scritto:
>> is there a way to find the maximum within a structure?
>
> i have the numbers and i want the max for this numbers
>



Then just use max(). There is no difference if the numbers
are inside a struct or outside. (Matlab would become very
complicated if there was a different command to find maximum
of numbers when they are inside a struct vs. outside).

EDU>> clear A
EDU>> s=struct('my_numbers',rand(5,1));
EDU>> max(s.my_numbers)

0.8235

help max

--Nasser



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.