MATLAB Answers

0

Plotting "live" data inside while loop?

Asked by Paul Pogba on 6 Dec 2018
Latest activity Answered by ahmed nebli on 6 Dec 2018
I'm capturing data in real time, with 1 second interval. When I use "disp" command, I see correct values displayed and I want to plot them. However, MATLAB only starts plotting them after I pause the script. Is there a way to plot new data every second, replacing old? Do I need to use other function than "plot"?
hold on;
while true
% 3. Trigger radar chirp and get the raw data
[mxRawData, sInfo] = oRS.oEPRadarBase.get_frame_data;
ydata = mxRawData; % get raw data
disp(real(ydata));
plot(real(ydata));
end

  0 Comments

Sign in to comment.

1 Answer

Answer by ahmed nebli on 6 Dec 2018

i suggest you try using the function set like in the link bellow https://www.mathworks.com/help/matlab/ref/set.html

  0 Comments

Sign in to comment.