I want to find the x and y values of f(x,y) when f(x,y) is a minimum over x = -1:0.001:1 and y = -1:0.001:1.
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
James Adam
am 27 Aug. 2016
Beantwortet: Azzi Abdelmalek
am 27 Aug. 2016
I know how to get min(f). min(x) and min(y) just give -1, not their values when f(x,y) is a minimum. Please help. Thanks
0 Kommentare
Akzeptierte Antwort
Azzi Abdelmalek
am 27 Aug. 2016
x=-1:0.001:1
y=x
[ii,jj]=ndgrid(x,y]
z=sin(ii)+cos(jj) % Example
[min_val,index]=min(z)
xidx=x(index)
yidx=y(index)
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Resizing and Reshaping Matrices finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!