You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
10 lines
286 B
10 lines
286 B
1 year ago
|
function monCoeffs = BernsteinToMonomial(bernCoeffs)
|
||
|
n=length(bernCoeffs)-1;
|
||
|
monCoeffs=bernCoeffs;
|
||
|
for k=(n:-1:1)
|
||
|
for j=k:n
|
||
|
monCoeffs(j+1)= monCoeffs(j+1)-monCoeffs(j);
|
||
|
end
|
||
|
end
|
||
|
monCoeffs=monCoeffs.*(arrayfun(@(kk)nchoosek(n,kk),0:n));
|
||
|
end
|