I have a question regarding max
command in MATLAB
let's say I have x
and y
matrices:
x = [1 2 3 4 5 6 7 8 9]
y = [1 4 6 2 3 64 7 67 6]
Now, I know how to find x
value at which y
is maximum
xIndex = find(y==max(y));
maxXValue = x(xIndex);
something like this..
My questions are:
- Do I have to
plot(x, y)
in order to findx
value at whichy
is max? - Is there any way I can find that value without plotting?
- I would like to find it without plotting (or at least plot but not actually show it)