iterate.m

来自「biomedical stuffs...」· M 代码 · 共 20 行

M
20
字号
function [xvec,yvec]=iterate(xx)
%	[xvec,yvec]=iterate(xx)
%	Generates x and y vectors for plotting an iterated map
%	xx is the sequence of data points for the iterated map
%
%	This program is distributed as a supplement to the book
%	"Biomedical Signal Processing and Signal Modeling" by E. N. Bruce,
%	published by Wiley, 2000.  It is provided for educational use only.
%  While every effort has been made to insure its suitability to illustrate
%  principles described in the above book, no specific feature or capability 
%  is implied or guaranteed.
nx=length(xx);
vec=zeros(2*nx,2);
vec(1,:)=[xx(1),0];vec(2,:)=[xx(1),xx(1)];
for j=2:nx;
	vec(2*j-1,:)=[xx(j-1),xx(j)];
	vec(2*j,:)=[xx(j),xx(j)];
end
xvec=vec(:,1);yvec=vec(:,2);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?