由chuvke回答
https://stackoverflow.com/questions/6888780/realtime-plotting-in-matlab-using-surf
1) you can use the linkdata command or toolbar button (or even Tools -> Link from the plot window)
2) programmatically: you need to call the command 'refreshdata' to signal that new data is available:
%% Define the data t=linspace(0,2*pi,40); y=sin(t); %% Create the plot and set teh datasources h=plot(t,y) set(h,'YDataSource','y') set(h,'XDataSource','t') %% Now update the data and the plot pause y=sin(2*t); refreshdata
This shows it for the
plot
, but expectsurf
will behave the same.
surf 实时 动态图
最新推荐文章于 2022-04-19 23:52:12 发布