📄 getinsertlayermatrix.m
字号:
%线段式插值
%By Yang zhengfa
%2007-09-19
%out=A*[IN];IN为要进行行扩展的数据
%param specifications
%IN: IN的行数为m
%N : 为每两行之间插n行
function a=GetInsertLayerMatrix(m,n)
onum=(m-1)*n+m;%查值后的点数
a=zeros(onum,m);
adjust=zeros(onum,m); %调整矩阵,体现重力分异作用
%每个点的权重
weight=zeros(onum,m);
for wbp=1:1:m-1;
for wrow=1:1:n;
weight(wbp+wrow+n*(wbp-1),wbp)=1-wrow/(n+1);
weight(wbp+wrow+n*(wbp-1),wbp+1)=wrow/(n+1);
end;
end;
%赋值约束
for i=1:1:m;
a((n+1)*(i-1)+1,i)=1;
end;
a=a+weight+adjust;
%每行归一化
total=0;
for grow=1:1:onum;
for gcol0=1:1:m;
total=total+a(grow,gcol0);
end;
for gcol1=1:1:m;
a(grow,gcol1)=a(grow,gcol1)/total;
end;
total=0;
end;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -