Maximum of 2D data interpolation
Mostrar comentarios más antiguos
Hi, I have 2D data for which I know there is a single maximum, but the points spacing may not be ideal so the maximum may lie in between. Therefore I would like to use griddedInterpolant to find the maximum point. X and Y contain the points, Z the corresponding function value.
It should look something as:
F = griddedInterpolant(x_mat,y_mat,z_mat);
xmaxs = arrayfun(@(xx,yy)fminsearch(@(x,y)-F(x,y),xx,yy),[x_mat(ii) y_mat(ii)]);
Where I provide an initial guess ii. But this is not the right way of calling it for a 2D function I'm afraid...
Respuesta aceptada
Más respuestas (1)
That doesn't make sense.
F is only an approximating function between the grid points - you don't know if the "real" underlying function behaves like this.
If you cannot supply the "real" function for F, better just choose the z with maximum value and the corresponding x and y.
1 comentario
Albert Zurita
el 6 de Feb. de 2023
Categorías
Más información sobre Interpolation en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
