while reading someone’s code I came across this:
data = [data.a, data.b, data.c, ...
data.x, data.y'];
why does the y have a single quote after it? does it have something to do with its data type? I got this error after removing it:
??? Error using ==> horzcat
CAT arguments dimensions are not consistent.
can someone please explain? thanks!
The single quotation mark is Matlab’s
transpositionoperator. Ifxis a row vector thenx'is a column vector, and so forth.If
data.xanddata.yare both row vectors, it’s no surprise that your attempt to horizontally concatenatedata.xanddata.y'is unsuccessful, it’s not a well-defined operation, since the former is (I guess) a row vector and the latter (if I guess correctly) a column vector.