CSE 477
Quiz 1 / self graded

1. What is the code to print “a = 2”

a=2;

2. Generate an array containing the first 10 integers.

Do[a[[i]]=2a[[i]],{i,2,8}]

3.  Print the array a generated by this (try w/o running it first)

a=Table[1,{i,1,10}] (* initialize *)

4. Let a matrix be defined by 

     1  2  3  
a= 2  3  4  
     3  4  5  
	
Print the 3rd element in the second row, i.e., (Subscript[a, 2,3])

a={{1,2,3},{2,3,4},{3,4,5}};
Print["a2,3= ", a[[2,3]];

4. Let v be defined by 
v =    1  2  3  

Print a*v.

v={1,2,3};
Print[a.v];