作者ljuyentintho (小刘)
看板MATLAB
标题[讨论]Matlab跑不出想要的图
时间Wed Apr 13 01:26:00 2016
程式码如下:
iteration=100;
p=2;
theta_0=10*rand(p,1);
theta=theta_0;
PE_old=PE(theta);
for i=1:iteration
thetanew=10*rand(p,1);
PE_new=PE(thetanew);
if PE_new < PE_old
theta=thetanew;
PE_old =PE_new;
else
end
plot(i,PE_old)
end
目前是希望能跑出100个图
但是执行之後跑出来的图完全没有画线
请问该怎麽解决呢?
谢谢
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 140.114.54.170
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/MATLAB/M.1460481962.A.8AA.html
1F:推 sin55688: 先确定能画出一条线在说吧。你这种写法是画垂直的点 04/13 12:29
2F:→ sin55688: 另外需要用hold on; 才能保留旧的图 04/13 12:30
3F:→ kanin1389: 如果人家教对至少给点回应不要完全不回好吗 04/13 20:58
4F:→ ljuyentintho: k大我有用站内信联络s大了 04/14 21:45