2013-08-28 44 views
0

我使用此代碼Matlab;分散plot-卻將劇情

myfit = polyfit(R,E,1); 
r = polyval(myfit,R); 
plot(R, E, 'x'); 
hold on; 
plot(R, r, '-'); 
hold off; 

所以,我得到這個數字怎麼點右移,使得x軸從零開始?

由於

enter image description here

回答

3

使用axis命令:

>> axis([0 1 0 1]); 

設置的軸線(顯示範圍)的極限。

有關更多信息,請參閱axis doc

+0

非常感謝您的回答。 – Fatime

+0

我在每次迭代中都有這樣的陰謀,你知道如何在每次迭代中保存每個陰謀嗎?謝謝 – Fatime

+1

@Fatime - 你可以使用'getframe'將圖轉換爲圖像,並使用'imwrite'將圖像寫入文件。但是,如果您想要更詳細的答案 - 將此問題作爲新問題發佈 – Shai