📄 exa110201.m
字号:
%--------------------------------------------------------------------------
% exa110201.m, for fig11.2.1 and fig 11.2.2
%--------------------------------------------------------------------------
clear all
h0=sqrt(2)/8*[1,3,3,1];
x0=zeros(2,200000);
bak=1:1:200000;
x0(2,:)=0.01*bak;
for i=1:100;
x0(1,i)=1;
x0(2,i)=0.01*i;
end
N=100;
M=4;
for j=1:100;
x(1,j)=0;
end
x(1,101:200100)=x0(1,:);
for i=1:8;
x_new=exa110201_sub(h0,x0,N,M);
for j=1:100;
x(i+1,j)=0;
end
x(i+1,101:200100)=x_new(1,:);
x0=x_new;
N=N*2;
end
figure(1);
subplot(221);plot([1:2000]/110-0.8,x(1,1:2000));
grid;axis([-0.4,4,-0.5,1.5]);
subplot(222);
plot([1:2000]/110-0.8,x(2,1:2000));grid;
axis([-0.4,4,-0.5,1.5]);subplot(223);plot([1:2000]/110-0.8,x(3,1:2000));grid;
axis([-0.4,4,-0.5,1.5]);
subplot(224);plot([1:2000]/110-0.8,x(9,1:2000));grid;axis([-0.4,4,-0.5,1.5]);
h0=sqrt(2)/4*[-1,3,3,-1];
x0=zeros(2,200000);
bak=1:1:200000;
x0(2,:)=0.01*bak;
for i=1:100;
x0(1,i)=1;
x0(2,i)=0.01*i;
end
N=100;
M=4;
for j=1:100;
x(1,j)=0;
end
x(1,101:200100)=x0(1,:);
for i=1:8;
x_new=exa110201_sub(h0,x0,N,M);
for j=1:100;
x(i+1,j)=0;
end
x(i+1,101:200100)=x_new(1,:);
x0=x_new;
N=N*2;
end
figure(2);
subplot(221);plot([1:2000]/110-0.8,x(1,1:2000));axis([-0.4,4,-2,4]);grid;
subplot(222);plot([1:2000]/110-0.8,x(2,1:2000));axis([-0.4,4,-2,4]);grid;
subplot(223);plot([1:2000]/110-0.8,x(3,1:2000));axis([-0.4,4,-2,4]);grid;
subplot(224);plot([1:2000]/110-0.8,x(9,1:2000));axis([-0.4,4,-150,150]);grid;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -