Help with function/script polynom
显示 更早的评论
I'm supposed to make 3 different codes on how to getCoefficient, getplot and getPolynom in matlab. The first line in the getCoeff code is:
function [coeff] = getCoeff(Xp,Yp)
and I know if I've done it right all I should be able to type in
Xp=[1,4,5,6];
Yp=[5,14,21,70];
coeff=getCoeff(Xp,Yp)
it shouldnt matter what degree the polynom is in, the general look is: p(x)= an*x.^n + an-1*x.^n-1+...+a2*x.^2+a1x+a0
how do I put this in a function?
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Polynomials 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!