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!
Asked
Active
Viewed 2,130 times
0
-
Also see [this question](http://stackoverflow.com/questions/20054047/subscript-indices-must-either-be-real-positive-integers-or-logicals-generic-sol) for [the generic solution to this problem](http://stackoverflow.com/a/20054048/983722). – Dennis Jaheruddin Nov 27 '13 at 15:53
1 Answers
6
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)

Dennis Jaheruddin
- 21,208
- 8
- 66
- 122