MATLAB: MATLAB regression error with length of vector

regress

NumRocks=[1608 1277 1025 851 726 438 102 53 9 5 1]; %Number of rockfalls vector
Vol=[0.01 0.02 0.03 0.04 0.05 0.1 0.5 1 5 10 100]; %Volume in meters cubed
v=regress(NumRocksln,Volln)
Y must be a vector and must have the same number of rows as X.
Y and X are the same number of rows and columns? Why am I getting this error?

Best Answer

NumRocks=[1608 1277 1025 851 726 438 102 53 9 5 1]; %Number of rockfalls vector
Vol=[0.01 0.02 0.03 0.04 0.05 0.1 0.5 1 5 10 100]; %Volume in meters cubed
v=regress(NumRocks',Vol')
Make them column vectors....
Related Question