📄 polyadd.m
字号:
function AplusB=polyadd(A,B)
% POLYADD is a function that adds two polynomials.
% Vectors A and B represent the coefficients of
% polynomials A and B in descending powers of
% an independent variable.
% [AplusB]=POLYADD(A,B) where the AplusB vector contains
% resulting polynomial coefficients in descending
% powers of an independent variable.
% by Mario Laiseca 1993
if length(A) > length(B)
fil=zeros(1,length(A)-length(B));
B = [fil B];
elseif length(B) > length(A)
fil=zeros(1,length(B)-length(A));
A = [fil A];
end
AplusB =A + B;
while ~isempty(AplusB) & AplusB(1)==0
AplusB(1)=[];
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -