MATLAB Answers

sum of polynomials help

60 views (last 30 days)
Make a Matlab function called polyadd.m that accepts as input the coefficients of two polynomials and outputs the coefficients of the sum of the two polynomials. The first line should read:
function a = polyadd(c,d)
please help

Accepted Answer

Walter Roberson
Walter Roberson on 2 Apr 2018
Figure out which vector is shorter. Put enough zeros at the beginning of it to make the two the same length. Add the two, which will now be the same length.
Optionally look at the results and remove leading 0, just in case the coefficients of the two cancel out.

  0 Comments

Sign in to comment.

More Answers (0)

Sign in to answer this question.