How to generate a golden ratio graph in simulink
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Ragavendra Joshi
el 15 de Abr. de 2023
Comentada: Ragavendra Joshi
el 23 de Abr. de 2023
I want to generate a golden ratio graph using xy graph block. Can someone help me?
2 comentarios
Sam Chak
el 15 de Abr. de 2023
Can you at least show the golden ratio equation in MATLAB code format for the plotting purposes?
Respuesta aceptada
Sam Chak
el 16 de Abr. de 2023
Editada: Sam Chak
el 18 de Abr. de 2023
18 Apr 2023 (Update): Here are the basic blocks in Simulink that you can use to create the Golden Ratio Spiral plot. The simulation time is
, the same as shown in the MATLAB code. Max Step size is set to 0.001.



16 Apr 2023: If you are looking to show something like this, then modify the code to plot for a longer arclength.
t = linspace(0, 2*pi, 1000);
% define the Golden Ratio constant
phi = (1 + sqrt(5)) / 2;
% define parametric equations
x = cos(t);
y = sin(t);
x_phi = cos(t) .* exp(phi*t/(2*pi));
y_phi = sin(t) .* exp(phi*t/(2*pi));
% plotting
figure;
plot(x, y, 'Color', '#A7B7F7', 'linewidth', 2);
hold on;
plot(x_phi, y_phi, 'Color', '#3952B2', 'linewidth', 2);
legend('Circle', 'Golden Spiral');
title('Parametric equation of the Golden Ratio');
% other settings
grid on
axis equal;
box off;
13 comentarios
Sam Chak
el 23 de Abr. de 2023
Oh I see. You can '_smoothen_' the plot by running the sim at a smaller step size. Go to the config menu and set the max step size to 0.01 or 1e-3.
Más respuestas (0)
Ver también
Categorías
Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!