nonlinearreplace.m
来自「matlab波形优化算法经常要用到的matlab toolbox工具箱:yalm」· M 代码 · 共 48 行
M
48 行
function Z = nonlinearreplace(X,Y,W)
% Very slow, but easily coded. Hopefully not used much
U = sdpvar(length(W),1);
for kk = 1:length(Y)
Z = [];
for ii = 1:size(X,1)
temp = [];
for jj = 1:size(X,2);
[coeffs,base] = coefficients(X(ii,jj),Y(kk));
newp = 0;
for i = 1:length(base)
newp = newp + coeffs(i)*U(kk)^degree(base(i));
end
temp = [temp newp];
end
Z = [Z;temp];
end
X = Z;
end
Y = U;
for kk = 1:length(Y)
Z = [];
for ii = 1:size(X,1)
temp = [];
for jj = 1:size(X,2);
[coeffs,base] = coefficients(X(ii,jj),Y(kk));
newp = 0;
for i = 1:length(base)
newp = newp + coeffs(i)*W(kk)^degree(base(i));
end
temp = [temp newp];
end
Z = [Z;temp];
end
X = Z;
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?