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

  1. 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);

  1. 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?

  1. 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

  1. Let z1 = 0 - 2i and z2 = 2.121 - 2.121i. Use Matlab to find z1 + z2. Show commands.
  2. Use Matlab to find the magnitude of z1, z2 and z3. Show commands.
  3. 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!