polyadd.m

来自「压缩文件中是Error Correction Coding - Mathemat」· M 代码 · 共 16 行

M
16
字号
function p = polyadd(a,b)% add the polynomials p=a+b% The polynomials are represented with the HIGHEST coefficient first% e.g., x^2 + 3x + 4 -- [1 3 4],   x^2 + 3x --- [ 1 3 0]% Copyright 2004 by Todd K. Moon% Permission is granted to use this program/data% for educational/research onlyk = length(b) - length(a);p = [zeros(1,k) a] + [zeros(1,-k) b];if(all(p==0))  p = 0;else  p = p(find((p==0)==0):end);   % get rid of leading zerosend

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?