How to plot an hexagon or square spiral shape ?
Show older comments
Hello I am trying to plot an spiral shape similar to one of the following figures(There is no difference, I need one of them, plooting in simple(solid) line is enough for me, I don't need markers on them) but I have no idea how to do it in matlab. Thanks in advance.

Accepted Answer
More Answers (1)
jonatan
on 8 Jul 2017
theta = 0:0.01:2*pi;
rho = min(abs(sec(t)), abs(csc(t)));
So if you want to create a spiral, you will need a small adjustment:
N = 10; %Number of spirals
theta = 0:0.01:2*pi*N;
rho = min(abs(sec(t)), abs(csc(t))) * theta;
You now can plot it using polarplot or convert it to Cartesian coordinates and using the regular plot function.
1 Comment
Örs Istok
on 2 Jun 2020
sorry but what is t?
Categories
Find more on Polar Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

