Borrar filtros
Borrar filtros

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.

1 visualización (últimos 30 días)
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

Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 27 de Ag. de 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)

Más respuestas (0)

Categorías

Más información sobre Resizing and Reshaping Matrices en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by