MUPAD plot multiple points
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
thomas mann
el 17 de Jun. de 2014
Respondida: Christopher Creutzig
el 1 de Sept. de 2014
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 comentarios
Respuesta aceptada
Christopher Creutzig
el 1 de Sept. de 2014
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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre 2-D Function Plots en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!