號令行鍵入:
x = [1 2];
y = [4 4];
%界說xy的值。
號令行鍵入:
plot(x,y);
%繪圖
號令行鍵入:
xlim([0 100])
ylim([2.5 4])
%限值xy的坐標規模。
號令行鍵入:
xlabel('Iteration')
ylabel('Approximation for \pi')
%添加標簽。
號令行鍵入:
linkdata on
%鏈接表達式。
號令行鍵入:
denom = 1;
k = -1;
for t = 3:100
denom = denom + 2;
x(t) = t;
y(t) = 4*(y(t-1)/4 + k/denom);
k = -k;
end
%輪回布局。
號令行鍵入:
axis off
%封閉坐標軸。
END0 篇文章
如果覺得我的文章對您有用,請隨意打賞。你的支持將鼓勵我繼續創作!