make_point.m

来自「matlab 双坐标轴 参考时请根据需要适当修改」· M 代码 · 共 18 行

M
18
字号
axis([0 10 -3 3]);
hold on
xy=[];
n=0;
disp('Left mouse button picks points.');
disp('Right mouse button picks last points.');
but=1;
while but==1
    [xi,yi,but]=ginput(1);
    plot(xi,yi);
    n=n+1;
    xy(:,n)=[xi;yi];
end
t=1:n;
ts=1:0.1:n;
xys=spline(t,xy,ts);
plot(xys(1,:),xys(2,:),'b-','linewidth',2);
hold off

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?