粘貼代碼
% 插入參數曲線h % 插入輔助線h1 % 並設置顏色,包括畫布顏色和曲線顏色 t=-pi:0.1:pi; x=cos(t)-sin(3*t); y=sin(t).*cos(t)-cos(3*t); h=plot(x,y); hold on h1=refline(1,0.5);%輔助線的使用,第一個參數是斜率,第二個是offset set(gca,'color','yellow');%畫布顏色 set(h,'color','blue');%參數曲線顏色 set(h1,'color','red');%輔助線顏色
參考《matlab教程》例1.1,二維和三維函數