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

 채택된 답변

Walter Roberson
Walter Roberson 2011년 12월 23일

0 개 추천

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

KSSV
KSSV 2011년 12월 24일
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 2011년 12월 24일
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 2011년 12월 26일
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 2020년 11월 18일
Thank you very much.
This worked for me too.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

질문:

2011년 12월 23일

댓글:

2020년 11월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by