iCAMP 77B – Homework 1 In class we learned how to centralize a vector of random numbers in 1 dimension. We will now repeat this but in two dimensions. a) Generate a matrix of random numbers of size 2 x 100. We will view this matrix as 100 two-dimensional vectors. Each such vector is therefore a point in plane. b) Plot all 100 vectors as a “cloud of dots” in a two-d plane. Use the function “plot” for this purpose. (You may first have to study this function by typing “help plot”). Change the markersize and linewidth of the dots. Try different types of markers and different colors until you are satisfied with how things look. c) Centralize the the two dimensional vectors by subtracting he mean in both dimensions. Talk to the supervising student to do this in vector form (this will require the use of the function “repmat”. Study this function. d) Now plot the centralized dot-cloud in a different color. Also try to plot the two dot clouds in one figure by using the command “hold on”. If you have time repeat this in 3 dimensions and use plot3 to plot things in 3d. You Can use rotate the angle by which you look at the dot cloud?
iCAMP 77B – Homework 1 In class we learned how to centralize a vector of random numbers in 1 dimension. We will now repeat this but in two dimensions. a) Generate a matrix of random numbers of size 2 x 100. We will view this matrix as 100 two-dimensional vectors. Each such vector is therefore a point in plane. b) Plot all 100 vectors as a “cloud of dots” in a two-d plane. Use the function “plot” for this purpose. (You may first have to study this function by typing “help plot”). Change the markersize and linewidth of the dots. Try different types of markers and different colors until you are satisfied with how things look. c) Centralize the the two dimensional vectors by subtracting he mean in both dimensions. Talk to the supervising student to do this in vector form (this will require the use of the function “repmat”. Study this function. d) Now plot the centralized dot-cloud in a different color. Also try to plot the two dot clouds in one figure by using the command “hold on”. If you have time repeat this in 3 dimensions and use plot3 to plot things in 3d. You Can use rotate the angle by which you look at the dot cloud?