Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

runtime plotting in matlab

Status
Not open for further replies.

nikhat_ahir

Newbie level 4
Joined
Mar 17, 2008
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
india
Activity points
1,370
hi,
i want to plot data in matlab with data getting updated runtime, and so, need plot to get updated also.
for example,
for i=1:10
% get data
plot(data);
end

but, what i m getting is only one plot at end of the entire for loop instead of all intermediate plots.

what should i do to get my problem solved?

thanks in advance.
 

1. if you want to plot data on different figure each time, insert 'figure' statement in your code as --

for i=1:10
% get data
figure;
plot(data);
end

2. if you want to plot data in the same plot you can use hold on and plot data
figure;
hold on;
for i=1:10
% get data
plot(data);
end
hold off

You can use different color for plotting
 

ya, i have tried with given answers, but they are not working.
exact solution i got, and it is to use 'pause' with some argument showing very less amount of time, such as pause(0.1), after plotting data each time.

thanks, and regards,
nikhat ahir.
 

use "line"

use 'erasemode' to be 'xor'
 

no. its better to use pause instead of line or something else.
u just have to put one function, such as, pause(0.1), after each time u call to plot function.

thanks, and regards,
nikhat ahir.
 

just use "line"

Added after 5 seconds:

just use "line"
 

The MATLAB command "drawnow" flushes pending graphics events.
Code:
for n=10:50
  plot(sin(n/100 * (0:99)));
  drawnow;
end
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top