my_plot3.m
来自「方便初学者学习」· M 代码 · 共 25 行
M
25 行
function my_plot3(x,y,z)
cax = newplot;
%检测当前的hold状态
hold_state = ishold;
LSO = ['- ';'--';': ';'-.'];
if nargin == 2
hlines = line(x,y,'Color','k');
%如果hold为off时,改变视图
if ~hold_state
view(2)
end
elseif nargin == 3
hlines = line(x,y,z,'Color','k');
%如果hold为off时,改变视图
if ~hold_state
view(3)
end
end
ls = 1;
for hindex = 1:length(hlines)
if ls > length(LSO),ls = 1;end
set(hlines(hindex),'LineStyle',LSO(ls,:))
ls = ls + 1;
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?