用matlab编的:::: 具体算法参考崔锦泰的《小波导论》,程正兴译%%%%%plot the wave of spline function%set the environment %clf reset close all %close all figure clear %clear all var clc %clear the screen format long;%set the parameters D = 4; % set the dimension of spline function/////////////////// step = 0.01; %set the step of plot multiplot = 1; %plot m figures(1) or only the m-th figure(0)%build the 1-D spline function m = 1; for x = 0:step:m - step n(1,round(x/step + 1)) = 1; end%plot the 1-D spline function figure(m); x = 0:step:m - step; plot(x,n(m,:)) xlabel('m') ylabel('N1(x)') title('1-D spline function')m = m + 1; %init the next m p(1,:) = [1 0];tic %set the timer%loop the m-D spline function count while(m <= D) %count the m-D for x = 0:step:m - step %count = fix(x/step + 1); count = round(x/step + 1); %convert count to integer temp = count; %count1 = fix(x/step - (1/step - 1)); count1 = round(x/step - (1/step - 1)); %convert count to integer
if count > ( m - 1 ) / step temp2 = 0; else temp2 = n(m-1,count); end if count1 < 1 temp1 = 0; else temp1 = n(m-1,count1); end n(m,temp) = x * temp2/(m-1) + (m-x) * temp1/(m-1); %formula end %sprint the standard value and max value %sprintf('The standard value(p) of %d-D spline function:',m) disp(['The standard value(p) of ' int2str(m) '-D spline function:']) p(m,1) = 0; for t=1:1:m-1 p(m,t+1) = n(m,t/step + 1); end p(m,m+1) = 0; standardvalue = p(m,:) %MAX = sprintf('The Max value(Max) of %d-D spline function:',m) disp(['The Max value(Max) of ' int2str(m) '-D spline function:']) c = m/step/2 + 1; Max = n(m,c)
%%plot the m-th figure; if m==D multiplot = 1; end if multiplot %plot the m-D figure(m); x = 0:step:m - step; plot(x,n(m,:),'r') xlabel('m') ylabel(['N' int2str(m) '(x)']) title([int2str(m) '-D spline function'])
%set the tick of axes-x,axes-y t = 1:1:m; set(gca,'xtick',t) t = 0:0.04:1; set(gca,'ytick',t) grid on
toc %kill the timer after any count end
%next m m=m+1; end%%toc %kill the timer
用matlab编的:::: 具体算法参考崔锦泰的《小波导论》,程正兴译%%%%%plot the wave of spline function%set the environment %clf reset close all %close all figure clear %clear all var clc %clear the screen format long;%set the parameters D = 4; % set the dimension of spline function/////////////////// step = 0.01; %set the step of plot multiplot = 1; %plot m figures(1) or only the m-th figure(0)%build the 1-D spline function m = 1; for x = 0:step:m - step n(1,round(x/step + 1)) = 1; end%plot the 1-D spline function figure(m); x = 0:step:m - step; plot(x,n(m,:)) xlabel('m') ylabel('N1(x)') title('1-D spline function')m = m + 1; %init the next m p(1,:) = [1 0];tic %set the timer%loop the m-D spline function count while(m <= D) %count the m-D for x = 0:step:m - step %count = fix(x/step + 1); count = round(x/step + 1); %convert count to integer temp = count; %count1 = fix(x/step - (1/step - 1)); count1 = round(x/step - (1/step - 1)); %convert count to integer
if count > ( m - 1 ) / step temp2 = 0; else temp2 = n(m-1,count); end if count1 < 1 temp1 = 0; else temp1 = n(m-1,count1); end n(m,temp) = x * temp2/(m-1) + (m-x) * temp1/(m-1); %formula end %sprint the standard value and max value %sprintf('The standard value(p) of %d-D spline function:',m) disp(['The standard value(p) of ' int2str(m) '-D spline function:']) p(m,1) = 0; for t=1:1:m-1 p(m,t+1) = n(m,t/step + 1); end p(m,m+1) = 0; standardvalue = p(m,:) %MAX = sprintf('The Max value(Max) of %d-D spline function:',m) disp(['The Max value(Max) of ' int2str(m) '-D spline function:']) c = m/step/2 + 1; Max = n(m,c)
%%plot the m-th figure; if m==D multiplot = 1; end if multiplot %plot the m-D figure(m); x = 0:step:m - step; plot(x,n(m,:),'r') xlabel('m') ylabel(['N' int2str(m) '(x)']) title([int2str(m) '-D spline function'])
%set the tick of axes-x,axes-y t = 1:1:m; set(gca,'xtick',t) t = 0:0.04:1; set(gca,'ytick',t) grid on
http://www.betajin.com/alphasun/index.htm
DocWizard C++程序文档自动生成工具 | Wave OpenGL 水波与动模拟和显示
具体算法参考崔锦泰的《小波导论》,程正兴译%%%%%plot the wave of spline function%set the environment
%clf reset
close all %close all figure
clear %clear all var
clc %clear the screen
format long;%set the parameters
D = 4; % set the dimension of spline function///////////////////
step = 0.01; %set the step of plot
multiplot = 1; %plot m figures(1) or only the m-th figure(0)%build the 1-D spline function
m = 1;
for x = 0:step:m - step
n(1,round(x/step + 1)) = 1;
end%plot the 1-D spline function
figure(m);
x = 0:step:m - step;
plot(x,n(m,:))
xlabel('m')
ylabel('N1(x)')
title('1-D spline function')m = m + 1; %init the next m
p(1,:) = [1 0];tic %set the timer%loop the m-D spline function count
while(m <= D)
%count the m-D
for x = 0:step:m - step
%count = fix(x/step + 1);
count = round(x/step + 1); %convert count to integer
temp = count;
%count1 = fix(x/step - (1/step - 1));
count1 = round(x/step - (1/step - 1)); %convert count to integer
if count > ( m - 1 ) / step
temp2 = 0;
else
temp2 = n(m-1,count);
end
if count1 < 1
temp1 = 0;
else
temp1 = n(m-1,count1);
end
n(m,temp) = x * temp2/(m-1) + (m-x) * temp1/(m-1); %formula
end %sprint the standard value and max value
%sprintf('The standard value(p) of %d-D spline function:',m)
disp(['The standard value(p) of ' int2str(m) '-D spline function:'])
p(m,1) = 0;
for t=1:1:m-1
p(m,t+1) = n(m,t/step + 1);
end
p(m,m+1) = 0;
standardvalue = p(m,:)
%MAX = sprintf('The Max value(Max) of %d-D spline function:',m)
disp(['The Max value(Max) of ' int2str(m) '-D spline function:'])
c = m/step/2 + 1;
Max = n(m,c)
%%plot the m-th figure;
if m==D
multiplot = 1;
end
if multiplot
%plot the m-D
figure(m);
x = 0:step:m - step;
plot(x,n(m,:),'r')
xlabel('m')
ylabel(['N' int2str(m) '(x)'])
title([int2str(m) '-D spline function'])
%set the tick of axes-x,axes-y
t = 1:1:m;
set(gca,'xtick',t)
t = 0:0.04:1;
set(gca,'ytick',t)
grid on
toc %kill the timer after any count
end
%next m
m=m+1;
end%%toc %kill the timer
具体算法参考崔锦泰的《小波导论》,程正兴译%%%%%plot the wave of spline function%set the environment
%clf reset
close all %close all figure
clear %clear all var
clc %clear the screen
format long;%set the parameters
D = 4; % set the dimension of spline function///////////////////
step = 0.01; %set the step of plot
multiplot = 1; %plot m figures(1) or only the m-th figure(0)%build the 1-D spline function
m = 1;
for x = 0:step:m - step
n(1,round(x/step + 1)) = 1;
end%plot the 1-D spline function
figure(m);
x = 0:step:m - step;
plot(x,n(m,:))
xlabel('m')
ylabel('N1(x)')
title('1-D spline function')m = m + 1; %init the next m
p(1,:) = [1 0];tic %set the timer%loop the m-D spline function count
while(m <= D)
%count the m-D
for x = 0:step:m - step
%count = fix(x/step + 1);
count = round(x/step + 1); %convert count to integer
temp = count;
%count1 = fix(x/step - (1/step - 1));
count1 = round(x/step - (1/step - 1)); %convert count to integer
if count > ( m - 1 ) / step
temp2 = 0;
else
temp2 = n(m-1,count);
end
if count1 < 1
temp1 = 0;
else
temp1 = n(m-1,count1);
end
n(m,temp) = x * temp2/(m-1) + (m-x) * temp1/(m-1); %formula
end %sprint the standard value and max value
%sprintf('The standard value(p) of %d-D spline function:',m)
disp(['The standard value(p) of ' int2str(m) '-D spline function:'])
p(m,1) = 0;
for t=1:1:m-1
p(m,t+1) = n(m,t/step + 1);
end
p(m,m+1) = 0;
standardvalue = p(m,:)
%MAX = sprintf('The Max value(Max) of %d-D spline function:',m)
disp(['The Max value(Max) of ' int2str(m) '-D spline function:'])
c = m/step/2 + 1;
Max = n(m,c)
%%plot the m-th figure;
if m==D
multiplot = 1;
end
if multiplot
%plot the m-D
figure(m);
x = 0:step:m - step;
plot(x,n(m,:),'r')
xlabel('m')
ylabel(['N' int2str(m) '(x)'])
title([int2str(m) '-D spline function'])
%set the tick of axes-x,axes-y
t = 1:1:m;
set(gca,'xtick',t)
t = 0:0.04:1;
set(gca,'ytick',t)
grid on
toc %kill the timer after any count
end
%next m
m=m+1;
end%%toc %kill the timer