torsade.m
来自「用matlab实现利用统计混沌方法解决非线性系统时间序列预测的问题」· M 代码 · 共 37 行
M
37 行
function out = torsade(nbr,angle,loops,width)
% The function:
%
% out = torsade(nbr,angle,loops,width)
%
% generates a 3-dimensional database with <nbr> elements.
% These elements draw a circular twisted ribbon (with
% diameter = 2.0);
% The optional parameter <angle> gives the number of
% revolution; for example, 0.5 gives an half circle
% ribbon; default value is 1.0.
% The optional parameter <loops> gives the number of
% ribbon "twists" for <angle> revolutions;
% default value is 0.5.
% The optional parameter <width> gives the width of the
% ribbon; default value is 0.5.
% The call by default:
%
% torsade(nbr)
%
% generates a moebius ribbon.
if nargin<2, angle = 1.0; end;
if nargin<3, loops = 0.5; end;
if nargin<4, width = 0.5; end;
a1 = 2*pi*angle*rand([nbr,1]);
a2 = loops/angle*a1;
w1 = width*(0.5-rand([nbr,1]));
out = zeros([nbr,3]);
out(:,1) = (1+w1.*cos(a2)) .* cos(a1);
out(:,2) = (1+w1.*cos(a2)) .* sin(a1);
out(:,3) = w1.*sin(a2);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?