Hi there, I'm trying to create a for loop to run the polyfit function for an array of numbers. The code I am currently using is:
for i=[1:11182];
x(i)=polyfit(Usable_Freq,Usable_Temp(i,:),1);
end
What I need the code to do is for each row of the Usable_Temp matrix, use the same row of Usable_freq and have polyfit run to return the values of this line.Using the above code when I run it, the following error returns: ???
In an assignment A(I) = B, the number of elements in B and I must be the same.
Error in ==> Loop_grad at 3 x(i)=polyfit(Usable_Freq,Usable_Temp(i,:),1);
Any help to resolve this would be greatly appreciated.
Best Answer