📄 spirale.m
字号:
function out = spirale(nbr,revo,step)
% The function
%
% out = spirale(nbr,revo,step);
%
% generates a 2-dimensional database with <nbr> elements.
% These elements draw a spiral.
% The optional parameter <revo> gives the number of
% revolution of the spiral; default value is 2.0.
% The optional parameter <step> sets the distance between
% two "consecutive spires"; default value is 1.0.
if nargin<2, revo = 2; end;
if nargin<3, step = 1; end;
r = rand([nbr,1]);
out = zeros([nbr,2]);
out(:,1) = step*revo*r.*cos(2*pi*revo*r);
out(:,2) = step*revo*r.*sin(2*pi*revo*r);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -