Replace the elements of a matrix
显示 更早的评论
Hello everyone,
I have an A matrix as
A=[a b ; c d ; e f ; g h]
and want to get B matrix as
B=[a ; b; c; d; e; f; g; h]
using A matrix. How can I code it? Thanks
采纳的回答
更多回答(2 个)
TADA
2019-6-9
B = reshape(A',numel(A),1)
1 个评论
Walter Roberson
2019-6-9
A' is only correct for real valued entries, as it is the conjugate transpose.
Walter Roberson
2019-6-9
B = reshape(A.',[],1);
类别
在 帮助中心 和 File Exchange 中查找有关 Matrices and Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!