so, i need to insert two variables (14 times each) and find the linear regression of those values
i wrote this code :
clear allclcn=input('give n:'); %, 's');
x=zeros(n,1); % pinakas nx1
y=zeros(n,1); % pinakas nx1 for i=1:nx(i)=input(['give x:' num2str(i,3)], 's');y(i)=input(['give y:' num2str(i,3)], 's'); endX=mean(x);Y=mean(y);b=sum((x-X).*(y-Y))/sum((x-X).*(x-X))a=Y-b*X
but each time i input two digit number i get this message: "Unable to perform assignment because the left and right sides have a different number of elements."
what am i doing wrong?
thank you
Best Answer