Info
This question is closed. Reopen it to edit or answer.
Using functions for polynomials
1 view (last 30 days)
Show older comments
Hello guys,
Im having trouble solving task 6 which is in the pdf file that I have shared.
This is what I have tried so far, but it's showing error message. I don't know how to carry on from this.
function ret=poly_fact(P1,P2)
a=size(P1)
b=size(P2)
orderP1=a(2)-1
orderP2=b(2)-1
for n=1:a(2)-1
if orderP1==orderP2 | orderP1>orderP2
if P1(1)==P2(1)
for n=1:(a(2)-b(2))
y=[0]
P2=horzcat(P2,y)
end
P1=P1-P2
else
d=P1(1)/P2(1)
P2=P2*d
end
else
disp('The order of P1 must be at least as high as the order of P2')
end
end
Can anyone help me with task 6.
Thank you.
1 Comment
dpb
on 15 Dec 2019
Well, you could show us what inputs you used and the error message for starters...
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!