Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

plot a graph in real time

Status
Not open for further replies.

robertodirosa

Computer
May 24, 2006
1
Hi!
Sorry for my english.
I'm working about the phenomena of "random walker", that is a object that walk random in one dimension. I have made the algorithm of the random walkers and i save the results on a matrix S(num,N), where num is the number of random walker and N is the number of iterations on the time. Now i have to show the walk on the window and i have tryed with this cycle:

while k <= N
.
.
plot(k,S:),k), ...
'EraseMode','none',...
'MarkerSize',6);
drawnow
.
.
k=k+1;
end

The problem are that plot only a point on the window each iteration(k) but i would a continuous line!!
Please help me!
 
The way I could see doing it is to create a vector, add the new value at each iteration, then plot that vector at the end of the iteration
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor