简体   繁体   中英

Convert a 1X9 array to a 9X1

I want to substract two arrays in Matlab but they are of different sizes. When I try to substract them, it says the following:

??? Error using ==> minus
Matrix dimensions must agree

Does anyone has a clue?

Thanks in advance,

@Jens Björnhager is correct: the transpose() function will do what you want, which is to flip one of your input vectors from a row-vector to a column-vector.

Alternately, Use the ' operator. A' is shorthand for transpose(A) .

尝试使用transpose()函数使大小匹配。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM