Department of Applied Mathematics at the University of Colorado at Boulder
University of Colorado at Boulder Search A to Z Campus Map University of Colorado at BoulderCU Search Links
Print this page

Plot Arrays

04: Create and plot an array

Create an array x=(2, 2.3, 2.6, ..., 4.7, 5)
and then plot   sqrt(x) vs. x --
as a line plot, and then as a point plot

Mathematica:

x = Table[ w, ]

ListPlot[Transpose[], PlotJoined->True]

ListPlot[Transpose[]]

Matlab:

x = 2 : 0.3 : 5      (or interactively)

plot(x, sqrt(x))

plot(x, sqrt(x), '*')

Maple:

t := [seq(2+i*0.3,i=0..10)];

listplot(map(sqrt,t));

listplot(map(sqrt,t),style=point);

IDL:

x = 0.3 * findgen(11) + 2

plot, x, sqrt(x)

plot, x, sqrt(x), psym=4