regression polynomial fit with any order and function

i have a function that can solve matrix with polynomial regression (fit with any function and order)
function [A] = betha_regpol(x,y,d)
%solving matrix using polynomial regression
%x and y are data
%d is order
k = length(x);
l = length(y);
%xt = ones(size(x));
c = zeros(d+1);
b = zeros(d+1,1);
dt2 = 0;
d2 = 0;
if k~=1
is it correct or not? and please explain why do i use zeros function thankyou

1 件のコメント

John D'Errico
John D'Errico 2018 年 4 月 13 日
Please learn to format your code so it is readable. I did that here. Read this:
https://www.mathworks.com/matlabcentral/answers/13205-tutorial-how-to-format-your-question-with-markup#answer_18099
Is your code correct? No. There is no attempt at a regression at all in that code.

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangePolynomials についてさらに検索

質問済み:

2018 年 4 月 13 日

コメント済み:

2018 年 4 月 13 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by