Hi I have a collection of scenes on the name K in mupad. I can plot these scenes using plot::(K[1],K[2],..K[end]). I can plot individual scenes by calling through its index. Is there any way to plot all scenes using plot(K)..something like this??
Is there any option called hold on as in MATLAB in mupad such that I can run loop and plot?
Thanks in advance
Sreenu

 Réponse acceptée

Walter Roberson
Walter Roberson le 23 Déc 2011

0 votes

I have not investigated plotting in MuPAD.
In Maple, plots are output as values with a particular structure that the pretty-printer recognizes and knows to draw. In Maple, you more or less join several plots together by just creating a list of the values and outputting that list, as in (Maple code)
P := [seq]( 'plot(K[i])' $ i=1..nops(K) );
plots[display](P);

4 commentaires

KSSV
KSSV le 24 Déc 2011
Ohk....I tried number of ways...I am unable to get it. I am able to plot it through plot(K[1],K[2],K[3]). If the scenes array is big I cannot every time type the command till the end...
Walter Roberson
Walter Roberson le 24 Déc 2011
Looking through the documentation, it appears that MuPad uses the same basic mechanism as Maple does. If your K is a list (not a Matrix or Vector) each element of which is a collection of graphic objects, then you can
plot(op(K))
since op() applied to a list results in an object sequence and functions are applied to object sequences.
If your K is an array or matrix or table, then
plot(seq('K[i]' $ i=1..N)
where N is the number of items in the array. Poking around it appears the easiest way to find the number of entries would be to use op() on the structured type to pull out the left and right sides of the index range stored in the object. Easier, perhaps, to coerce() the structured type in to a list.
KSSV
KSSV le 26 Déc 2011
Hi
I tried number of ways....as you people have discussed. Finally plot(K[i]$i=1..N) worked out. There should be no space between ] and $ . Earlier I tried with space....Am happy that it worked....
Thanks a lot Walter Roberson, for your command...
Sreenu
Mara Gati
Mara Gati le 18 Nov 2020
Thank you very much.
This worked for me too.

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by