程式碼如下:
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個圖
但是執行之後跑出來的圖完全沒有畫線
請問該怎麼解決呢?
謝謝