how reshape this matrix in matlab? thx
2 次查看(过去 30 天)
显示 更早的评论
I have this matrix: for example:
into:
how can I do it without using loop? can mat2cell be useful in this case?
many thanks!!
1 个评论
采纳的回答
Matt J
2015-1-4
编辑:Matt J
2015-1-4
If the 3x3 blocks are symmetric, as in your example, a simple transpose is all you need. If, more generally, they are not, however,I would recommend MAT2TILES ( Download ) as follows
C=mat2tiles(YourMatrix,[3,3]);
YourMatrixReshaped = cell2mat(C.')
1 个评论
Stephen23
2015-1-4
Mathematically correct, but it probably would be still best to introduce beginners to the nonconjugate transpose: .'
更多回答(1 个)
the cyclist
2015-1-4
编辑:the cyclist
2015-1-4
If your original matrix is A, then transpose it:
B = A'
[This is actually the complex conjugate transpose, but assuming your matrix is real, that's OK. You can read more with "doc transpose" and "doc ctranspose".]
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!