Extract several matrices from single column vector
古いコメントを表示
Hey,
I have three matrices
A, B, C, D which I flatten to a single column vector:
J = [A(:); B(:); C(:); D(:)]
How can I used indexing to extract the matrices again? Unfortunately, I cannot use reshape because J is a vector of realp objects.
Basically I want to do this:
A = J(idxA);
B = J(idxB);
C = J(idxC);
D = J(idxD);
Thanks for your help!
6 件のコメント
Dyuman Joshi
2023 年 10 月 24 日
What's the objective here? Why do you need to store matrices and extract them with the same shape?
Have you considered storing the matrices in a cell array?
Cedric Kotitschke
2023 年 10 月 24 日
Bruno Luong
2023 年 10 月 24 日
"The problem is that reshaping and matrix indexing is somehow buggy for genmat objects"
Please show an example.
Dyuman Joshi
2023 年 10 月 24 日
I guess you can not convert to double and then do the operations.
Have you considered storing the (genmat) matrices in a cell array?
Cedric Kotitschke
2023 年 10 月 24 日
Bruno Luong
2023 年 10 月 24 日
I don't know genmat objects. I'll delete my answer.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Signal Attributes and Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!