MUPAD plot multiple points
11 ビュー (過去 30 日間)
古いコメントを表示
thomas mann
2014 年 6 月 17 日
回答済み: Christopher Creutzig
2014 年 9 月 1 日
I know its a basic question but i am stuck and could not find the answer yet:
How to plot multiple points? In Matlab if i have a vector (e.g.
r = 2:6
), they all can be plotted by
plot(3,r)
In Mupad, plot(3,r) does not work... What is the correct syntax?
0 件のコメント
採用された回答
Christopher Creutzig
2014 年 9 月 1 日
If you already have multiple points (not just the vector r), you can get a line through them this way:
plot([[1,2],[3,10],[4,6]])
Or dots at those places like this (or use plot::PointList2d):
plot({[1,2],[3,10],[4,6], #Points})
If you have a vector, list of values, or sequence of values (these are different in MuPAD, though not in MATLAB), such as r := [$2..6], and want to get the equivalent to MATLAB's plot(3,r), you need to convert them to a point list first:
r := [$2..6]:
plot([[3,y] $ y in r]) // line, a bit pointless
plot([[3,y] $ y in r], PointsVisible) // more pointed
plot({[3,y] $ y in r, #Points}) // single color
plot([3,y] $ y in r, #Points) // individually colored
0 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!