MATLAB Answers


How can I which value that be used to calculate a function

Asked by Tianze Li on 14 May 2019
Latest activity Commented on by Fangjun Jiang on 17 May 2019
In this casue, I difine a range for x and y, and then calculated the min value of L, but how do i find which x vaule and y value to calculate the min L? Many thanks!!!!!


Sign in to comment.


No tags entered yet.




2 Answers

Answer by Fangjun Jiang on 14 May 2019
Edited by Fangjun Jiang on 14 May 2019
 Accepted Answer

You need to run min() twice
or better


Yes. It did show the row and coloum for both x and y. But how can i display the value from that row and coloum instead of to find them from the array
Not clear what you mean. Maybe in your example, you are looking for x(Ix), y(Iy)?

Sign in to comment.

Answer by Steven Lord
on 14 May 2019

Since you indicate that you're using release R2019a, call min with the 'linear' option and two output arguments. This will give you the linear index of the minimum value, and you can use that index into x and y.


Sign in to comment.