Hej,
I try to do a multi linear regression between two vectors, but I recieve an error in the length of the vector, although the number of rows is equal (size: 1540x4 and size: 1540x1), see below. Can anyone explain this error and how to fix it?
cheers,
Jeroen
>> b = regress(Mean_wall_1(:,[5 10 11 12]),Q_201_cl(:,2));
Error using regress (line 62)
Y must be a vector and must have the same number of rows as X.
>> size(Mean_wall_1(:,[5 10 11 12]))
ans =
1540 4
>> size(Q_201_cl(:,2))
ans =
1540 1

 Réponse acceptée

Fangjun Jiang
Fangjun Jiang le 25 Fév 2019

0 votes

Switch your X and Y. Read the help of regress()

2 commentaires

Jeroen van Eldert
Jeroen van Eldert le 25 Fév 2019
Thanks,
I overlooked in 4 times, still the error message does not make sence..
/Jeroen
Fangjun Jiang
Fangjun Jiang le 25 Fév 2019
Agreed. Many times the error message is rather confusing.

Connectez-vous pour commenter.

Plus de réponses (0)

Produits

Version

R2016b

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by