use a matlab program gram description below Program Description: The purpose of
ID: 2249020 • Letter: U
Question
use a matlab program
Explanation / Answer
THe question is incomplete. Lots of information is missing. The fractal equations for sunflower ..etc are not given, even though the matlab code is generated it will work fine for these quations.
Xk+1=Yk(1+sin0.7Xk) -1.2rad(abs(xk))
Yk+1 =0.21 - Xk
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
x = zeros(1, 250);
y = zeros(1, 250);
for k=2:250
x(k)=(y(k-1)*(1+sin(0.7*x(k-1))))-(1.2*abs(x(k-1)));
y(k)=0.21-x(k-1);
end
figure
subplot(2,2,1) % add first plot in 2 x 2 grid
plot(x,y,'.'); % line plot
xlim([-1 0.5])
ylim([-0.5 1])
title('Fractal Plot with 250 points')
x1 = zeros(1, 2500);
y1 = zeros(1, 2500);
for k=2:2500
x1(k)=(y1(k-1)*(1+sin(0.7*x1(k-1))))-(1.2*abs(x1(k-1)));
y1(k)=0.21-x1(k-1);
end
subplot(2,2,2) % add second plot in 2 x 2 grid
plot(x1,y1,'.');
xlim([-1 0.5])
ylim([-0.5 1.5])
title('Fractal Plot with 2500 points')
x2 = zeros(1, 5000);
y2 = zeros(1, 5000);
for k=2:5000
x2(k)=(y2(k-1)*(1+sin(0.7*x2(k-1))))-(1.2*abs(x2(k-1)));
y2(k)=0.21-x2(k-1);
end
subplot(2,2,3) % add third plot in 2 x 2 grid
plot(x2,y2,'.');
xlim([-1 0.5])
ylim([-0.5 1.5])
title('Fractal Plot with 5000 points');
x3 = zeros(1, 20000);
y3 = zeros(1, 20000);
for k=2:20000
x3(k)=(y3(k-1)*(1+sin(0.7*x3(k-1))))-(1.2*abs(x3(k-1)));
y3(k)=0.21-x3(k-1);
end
subplot(2,2,4) % add fourth plot in 2 x 2 grid
plot(x3,y3,'.');
xlim([-1 0.5])
ylim([-0.5 1.5])
title('Fractal Plot with 20000 points')
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.