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: plotting many functions on the same screen
Replies: 2   Last Post: Jun 2, 2011 4:30 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Jim Rockford

Posts: 163
Registered: 6/30/06
Re: plotting many functions on the same screen
Posted: Jun 2, 2011 3:38 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On Jun 2, 3:20 pm, "Mohammad " <jab...@uni.uiuc.edu> wrote:
> for i=1:5
>     t=linspace(0,2*pi,100);
>     x= ellipseperpoint(i,1)+ellipseperpoint(i,4)*cos(t-ellipseperpoint(i,3));
>     y= ellipseperpoint(i,2)+ellipseperpoint(i,5)*sin(t-ellipseperpoint(i,3));
>     plot(x,y);
> end
>
> I have 5 parametrix functions of x and y that I want to plot on the same screen. My current loop replaces each previous function such that only the last parametric equation lasts. Is there an easy way to avaoid this without hardwiring all five equations on the screen.
>
> Thanks!
>
> Cordially, Mohammad



Right before the "end" statement put "if i == 1, hold on; end"

Read the documentation on "hold"

Jim



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.