Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

We will be growing ferns by random repetition of a few simple matrix/vector tran

ID: 3636812 • Letter: W

Question

We will be growing ferns by random repetition of a few simple matrix/vector
transformations. We have seen, on the lecture page, how to multiply a 2-by-2
matrix and a 2-by-1 vector and we have interpreted the “action” via stretching
and rotation. A third natural geometric transformation is to shift or translate.
This is done algebraically by simple vector addition. In particular, if
x=[x(1);x(2)] and y=[y(1);y(2)] are two 2-by-1 vectors then their sum z=x+y
is also 2-by-1 and its elements are z(1)=x(1)+y(1) and z(2)=x(2)+y(2).
The old-school fern below was produced by this code. You see that at each step
it generates a random number and applies one of two possible transformations,
the first with probability 0.3 and the second with probability 0.7.
Your task is to dissect and document this existing code and then to write
and run code (called fern.m) that produces a significantly more interesting fern.
In particular, your new program should successively generate a random number
and should
apply z = [0 0;0 0.16]*z with p = 0.01
apply z = [0.85 0.04; -0.04 0.85]*z + [0; 1.6] with p = 0.85
apply z = [0.2 -0.26; 0.23 0.22]*z + [0; 1.6] with p = 0.07
apply z = [-0.15 0.28; 0.26 0.24]*z + [0; 0.44] with p = 0.07

**********You should accomplish this with a single if clause, although, given that
your logic now forks four ways, you will want to make use of some subordinate
elseif statements.


I have had no previous programming experience and would like someone to guide me through this apparently simple code for a Fern. Note: This is for MATLAB introductory class.



Explanation / Answer

H(alpha) has p = floor(n/2) eigenvalues that are equal to zero. The rest of the eigenvalues are equal to 4*alpha*cos(k*pi/(n+2))^2, k=1:n-p. circul — Circulant matrix

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote