Finding all existing minimums of a function
显示 更早的评论
I have this function:
I need to find all existing minimums of this function using fminsearch and also draw a 3D plot with minimum points highlighted on it.
What I've tried so far:
fun2 = @(x,y)x^4+y^4-2*x^2+4*x*y-2*y^2+1
x = fminsearch(@(v) fun2(v(1),v(2)),[-5,-5])
figure
[X, Y] = meshgrid(-2:0.1:2);
surf(X,Y,fun2(X,Y));
Result doesn't seem right:


采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!