Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Reference a vector to a plot
Replies: 6   Last Post: Jan 20, 2011 5:05 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Markus Due Jakobsen

Posts: 43
Registered: 4/29/08
Reference a vector to a plot
Posted: Nov 26, 2010 9:23 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi
Is it possible to reference a vector to a plot without constantly re-setting the plot settings i.e. ‘xdata’ and ‘ydata’?

Example:
Xdata = [1:100]'; Ydata = rand(100,10); L=length(Ydata);
f = plot(Xdata,Ydata);
for m=1:10;
I = round(L*rand(1)); pause(1)
Y = Ydata(1:I,:); X = Xdata(1:I);
for j=1:10
set(f(j),'Xdata',X,'Ydata',Y(:,j))
end
end

So what I actually want is every time the vector changes I want to plot the changed vector simulateneusly.

Any suggestions?
Markus



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.