Question: Scatterplot, Matrices and Rotation Write a program to generate points of the Gingerbread describe in the Lecture notes. Let x(1) = -0.1; y(1) = 0;
Scatterplot, Matrices and Rotation
- Write a program to generate points of the Gingerbread describe in the Lecture notes. Let x(1) = -0.1; y(1) = 0; Create loop to calculate 9999 additional points where subsequent points are calculated from the prior points as follows:
x(i+1) = 1 - y(i) + abs(x(i));
y(i+1) = x(i);
- Create a 10000 row by 2 column matrix using the following statement:
p = [x,y];
Plot the gingerbread man using the following statement:
Plot(p(:,1), p(:,2), b.);
What is the colon doing?
- Plot again, but first recalculate p as follows:
angle = pi/2;
R = [sin(angle), cos(angle); -cos(angle), sin(angle)];
p = p*R;
This example demonstrates rotation of data using matrix multiplication. See affine transformations for more information.
Complex Numbers
- Let z1 = 0 - 2i and z2 = 2.121 - 2.121i. Use Matlab to find z1 + z2. Show commands.
- Use Matlab to find the magnitude of z1, z2 and z3. Show commands.
- Use Matlab to find the angles of z1, z2 and z 180/pi*angle(z) for units in degrees.
.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
