matlab';s addpoints函数停止工作,它表示I';我正试着把脚本作为一个函数来使用

matlab';s addpoints函数停止工作,它表示I';我正试着把脚本作为一个函数来使用,matlab,plot,Matlab,Plot,我只是想给动画线条添加点,如下所示: f=figure('Visible','on','units','normalized','outerposition',[0 0 1 1],'Numbertitle','off','Name','test'); for i=1:2 S(i)=subplot(2,1,i,'Parent',f); h(i)=animatedline(S(i),'color','b','marker','.'); end i=1;x=[1 2]; for j=1

我只是想给动画线条添加点,如下所示:

f=figure('Visible','on','units','normalized','outerposition',[0 0 1 1],'Numbertitle','off','Name','test');
for i=1:2
    S(i)=subplot(2,1,i,'Parent',f);
    h(i)=animatedline(S(i),'color','b','marker','.');
end
i=1;x=[1 2];
for j=1:numel(h)
    addpoints(h(j),i,x(j));
end
但我得到了这个错误:

Attempt to execute SCRIPT addpoints as a function:
/usr/local/MATLAB/R2019b/toolbox/matlab/graphics/addpoints.m
请注意,上次我使用它时,它工作得很好

顺便说一句,我正在ubuntu 18.04下使用MatlabR2019b

我转到matlab的安装目录并
查找-键入f-名称“addpoints.m”
告诉我:

./mcr/toolbox/matlab/graphics/addpoints.m
./toolbox/distcomp/array/+parallel/+internal/+array/@PlottableUsingGather/addpoints.m
./toolbox/matlab/graphics/addpoints.m
在这三个文件中,只有最后一个不是空的,它只是一个帮助文件,没有任何功能

编辑: 在matlab上,
哪个addpoints-all
给了我:

/usr/local/MATLAB/R2019b/toolbox/matlab/graphics/addpoints.m
addpoints is a built-in method                                % matlab.graphics.animation.AnimatedLine method

如果从命令窗口运行
哪些addpoints-all
,会得到什么?这将按路径上的名称告诉您函数的优先顺序添加到问题:)将
which
语句添加到调用
addpoints
的脚本/函数中。在脚本中,您可能有不同的搜索路径。@CrisLuengo我从
中得到了与脚本中相同的结果。对不起,我没有主意了(