a1=Table[ Sqrt[n], {n,1,9} ] exact a1=Table[ N[Sqrt[n]], {n,1,9} ] numerical |
Create an array of 15 random real values uniformly distributed between 0 and 10
a2 = Table[10Random[],{15}] |
Create a 5×5 array of integer chosen randomly between 1 and 100
a3 = Table[Random[Integer,{1,100}],{5},{5}] |
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
x = Table[ w, {w, 2.0, 5.0, 0.3} ] |
Define the following vectors of 9 elements each:
u = (7, 4, 9.9, 0, 4, 3, 6, 2.1, 1.9)
v = (0, 0, 0, 0, 0, 0, 0, 0, 0)
w = (1.1, 1.2, 1.3, ..., 1.9)
u = {7,4,9.9,0,4,3,6,2.1,1.9} |
Add two vectors (each of 7 elements), then plot the values of the result:
u = (3,0,1,4,2,6,4)
v = (1,2,3,4,5,6,7)
plot w = u + v
u = {3,0,1,4,2,6,4} |