linear regression of a non-linear dataset

조회 수: 1 (최근 30일)
J.P.
J.P. 2016년 11월 11일
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!

답변 (0개)

카테고리

Help CenterFile Exchange에서 Linear Regression에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by