简体   繁体   中英

Extract max/min values from a table in workspace in Matlab

Back to basics. How can I extract max and min values from 'variable' table in workspace? min(nameofvariable) don't work, returns an error message 'Subscript indices must either be real positive integers or logicals'. Thanks for your help!

Assuming you have a matrix called nameofvariable , the correct syntax is indeed:

min(nameofvariable) 

This will give you the column wise min

For the full minimum:

min(nameofvariable(:))

The error you have suggests that you have a variable named min (try to avoid this at all times), try:

clear min
min(nameofvariable) 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM