|
From: | Søren Hauberg |
Subject: | Re: Multiple plots |
Date: | Wed, 18 Jul 2007 13:33:13 +0200 |
User-agent: | Thunderbird 1.5.0.12 (X11/20070604) |
If you use 'hold' simple do something like hold on for i = 1:length(N) X = linspace(0, l, N(i))/lambda; Y = f(X, N(i)); % I don't know how this line looks, % as it depends on how 'f' is declared. plot(X, Y); endfor hold off I don't think you can do something like this by plotting a matrix. SørenP.S. A good way to figure these things out, is just to try it at the Octave prompt. Sure, you'll get some errors once in a while, but they don't hurt anybody :-)
asha g skrev:
The x axis is x = linspace(0,l,N)X = x/lambda So as N varies, X varies. How do you put that on oneplot?Asha --- Søren Hauberg <address@hidden> wrote:I don't quite understand your problem. You can usethe 'hold' command to plot several plots on one figure. The code for this looks something like this:figure hold on for N = 10: 10: 40 plot(f(N), Y) endfor hold off or you can put all your data in a matrix and thenplot that matrix. This would look something like thisN = 10: 10: 40; data = zeros(length(X), length(N)); for i = 1:length(N) data(:, i) = f(N(i)); endfor plot(data) I haven't tested any of the above code, butsomething similar to the two examples should work for you.Søren asha g skrev:Could someone tell me what the command is formultipleplots. Basically I have N = 10: 10: 40I am plotting a fn X vs Y for the various valuesof Nand would like them to be in the same plotideallybut I get an error message for that as X = f(N). So I would like to plot it in subplots. I tried mplot(X,Y) but I get an error message : 'mplot' undefined. thanksAsha Goals too clearly defined can become blinkers. Mary Catherine Bateson____________________________________________________________________________________Building a website is a piece of cake. Yahoo!Small Business gives you all the tools to get online.http://smallbusiness.yahoo.com/webhosting _______________________________________________Help-octave mailing list address@hiddenhttps://www.cae.wisc.edu/mailman/listinfo/help-octaveGoals too clearly defined can become blinkers. Mary Catherine Bateson____________________________________________________________________________________ Yahoo! oneSearch: Finally, mobile search that gives answers, not web links. http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC
[Prev in Thread] | Current Thread | [Next in Thread] |