how to plot test function graph?
显示 更早的评论
hello.. i juz wanna ask , using this function how to plot its 2D graph?
function f = dropwavefcn(x)
if strcmpi(x,'init')
f.PopInitRange = [-2;2] ;
f.KnownMin = [0 0] ; % For plotting purposes only
else
if size(x,2) > 2
warning('psopt:demos:toomanydims',...
'Only using first two dimensions of search space')
elseif size(x,2) < 2
error('Drop Wave Function requires two dimensions')
end
x = reshape(x,1,[]) ;
f = -(1 + cos(12*norm(x(1:2))))/(0.5*x(1:2)*x(1:2)'+2) ;
end
i really need the answer as soon as possible...thanks for your concern
1 个评论
Oleg Komarov
2012-5-28
http://www.mathworks.com/matlabcentral/answers/29922-why-your-question-is-not-urgent-or-an-emergency
回答(1 个)
Oleg Komarov
2012-5-28
plot(x,dropwavefcn(x))
1 个评论
Oleg Komarov
2012-5-28
@siti: does this answer your question?
类别
在 帮助中心 和 File Exchange 中查找有关 Networks 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!