(X',Y') in Matlab

1 view (last 30 days)
LESE
LESE on 24 Mar 2015
Commented: Star Strider on 25 Mar 2015
I wanted to know what is the codes: [U,T] = regression(A',B') means in matlab, I know that A' means transpose but as A is a vector I can not understand how it works here.

Answers (1)

Star Strider
Star Strider on 24 Mar 2015
You can certainly transpose a vector. The transpose of a row vector is a column vector, for example.
  2 Comments
Star Strider
Star Strider on 25 Mar 2015
LESE’s ‘Answer’ moved here...
Yes that is correct but then the regression gives a matrix as the result. I need just one result for each answer of regression not a matrix.
Star Strider
Star Strider on 25 Mar 2015
I was simply pointing out how the transpose of a vector is defined.
Keep the vector as a row or column vector, depending on what your code requires. You may have to experiment with it (either as a row or column vector) to get the result you want.
If you want to be sure that ‘A’ is always a column vector, refer to it in the argument list as: A(:). If you want it to always be a row vector, refer to it as: A(:)'. That way, you never have to worry about what it is in your code.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!