linear regression of a non-linear dataset
2 次查看(过去 30 天)
显示 更早的评论
Hello,
I want to use a linear regression for every three datas of my given dataset x1. I have a 3x480 matrix full of this data in the x and the y dimension. I was thinking of fitting every collom (3 datapoints) once and put the result of my magnitude into an array. I tried it using this loop:
U=double.empty(3,(length(x1)),0);
for u=1:1:length(x1)
uu = fitlm(x1(1:3,u),y1(1:3,u));
U(1:3,u)=uu.Fitted(1:3,1);
end
But it gives the Error
Attempt to grow array along ambiguous dimension.
Error in polyfit_Inet_v4 (line 26)
What am I doing wrong? Thank you for your help!