Optimization Problem
信息
此问题已关闭。 请重新打开它进行编辑或回答。
显示 更早的评论
Would anybody help me on the following:
syms x
min((normcdf((a-x.*b)/sqrt(1-x.^2)) - 0.1)^2) find x
However, matlab gives me an error message saying that normcdf can't take symbolic variable.
This is a simplified version of my problem so I prefer to use normcdf.
Thanks.
0 个评论
回答(1 个)
Teja Muppirala
2011-3-29
Are you trying to find the x that minimizes that expression as a function of those parameters a and b?
If you really want to represent that expression symbolically, you'll have to use ERF instead of NORMCDF.
normcdf(x) = 0.5 + 0.5*erf(x/sqrt(2))
But even if you do that, I don't think you'll be able to solve that analytically.
Finding a minimum numerically using FMINBND yields a very neat looking graph though:
a = -2:.05:2;
b = -2:.05:2;
A = nan(numel(b),numel(a));
h = surf(a,b,A);
zlim([-1 1]);
xlabel('a');
ylabel('b');
zlabel('x location of minimum');
for n = 1:numel(a)
for m = 1:numel(b)
F = @(x) (normcdf((a(n)-x.*b(m))./sqrt(1-x.^2)) - 0.1).^2;
A(m,n) = fminbnd(F,-1,1);
end
set(h,'ZData',A);
drawnow;
end
0 个评论
此问题已关闭。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!