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 Comment

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.

Sign in to comment.

Answers (0)

Categories

Asked:

on 13 Apr 2018

Commented:

on 13 Apr 2018

Community Treasure Hunt

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

Start Hunting!