Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

The application of "find", "max" and "min" functions in Matlab

Status
Not open for further replies.

cedance

Advanced Member level 2
Advanced Member level 2
Joined
Oct 24, 2003
Messages
551
Helped
30
Reputation
60
Reaction score
7
Trophy points
1,298
Location
Germany
Activity points
4,622
The application of "find", "max" and "min" functions in Matlab

hi,

pretty easy code.

there are functions in matlab. the "find" function along with "max" and "min" can be employed to get what u desire for. even find is not necessary unless u want to get the index of those values..

suppose ur matrix is a = magic(5);

then max(a) will list out 5 values, with each value the max of the columns of "a". check it out for better understanding. and if u take the max of this value, u get the max value of the matrix. that is , max(max(a)) will give the max element of the matrix. similarly min(min(a)) will give teh minimum of the matrix.

and then reg. the ascending order, if u want to sort the matrix rows each in ascending order, then u could use the matlab command, sort(a,2)

suppose u wanted to ascend column wise the mattrix a, then just sort(a) or sort(a,1) is enough.

and incase u want to arrange descend, then sort(a,2,'descend') is the syntax.

reg. printing.. u could save the output to a file and then print it.

hope ths s wat u asked for and it cleared. my wishes.

/cedance
 

    was29e

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top