Asked by Light
on 27 May 2013

How can i find max of 30 arguments max(H1,H2.....H30)

But error message occured "Error using max Too many input arguments.MAX with two matrices to compare and a working dimension is not supported"

Is there any other way?

*No products are associated with this question.*

Answer by Image Analyst
on 27 May 2013

Edited by Image Analyst
on 27 May 2013

Accepted answer

Put brackets around them to make them a single array, as my answer below shows.

Try this:

[maxValue, indexAtMaxValue] = max([H1, H2, H3, H4, ...ETC...... , H29, H30]);

Show 4 older comments

Image Analyst
on 27 May 2013

Once again: **You forgot to give us the values for the H's**, so we can't try my answer.

To drive the point home: How on earth am I supposed to know what value H01 takes on? Or what value any of the other variables have? The answer is I don't. Unless you supply them to me. **GIVE ME CODE THAT SAYS:**

H01 = 0.003342243423; % or whatever. ... H2022 = 0.233423423423; % or whatever. and so on, for all the H's.

Opportunities for recent engineering grads.

## 0 Comments