How can I make a vector in matlab, like vec(x)?
33 ビュー (過去 30 日間)
古いコメントを表示
Hello all,
I am trying to replicate this formula:

I am doing so as follows:
Theta = A*B-C;
vTheta = vec(Theta');
A, B en C are defined. The problem is that Matlab does not seem to know the function 'vec' to do what I would like to do with Theta as in the formula...

How can I fix this?
Thanks in advance!
3 件のコメント
Jan
2017 年 12 月 2 日
The problem is that Matlab does not seem to know the function 'vec'
"Does not seem" or do you get a real error message? If Matlab does not have such a function, you can fix this by writing it.
Sorry for this trivial answer, but the provided details do not allow to give a more specific one.
回答 (2 件)
Sean de Wolski
2018 年 1 月 2 日
I wrote a vec function in grad school for exactly this use. Here it is, authored almost exactly 7 years ago apparently!
attached.
0 件のコメント
Giacomo Romanini
2018 年 2 月 12 日
Suppose you have a matrix X. You can obtain a vec(X) simply by the following:
vecX = X(:);
1 件のコメント
Jonathan
2018 年 8 月 2 日
Already answered in the comments (2 Jan 2018), so kudos to Marcos Caso-Huerta
参考
カテゴリ
Help Center および File Exchange で Performance and Memory についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!