splitting a matrix into vectors

24 ビュー (過去 30 日間)
ganesh karuppasamy
ganesh karuppasamy 2020 年 6 月 27 日
回答済み: Matt J 2020 年 6 月 27 日
how can i split a matrix int row or column vectors with out looping condition help me some body please
suppose i have a matrix a=[123;456;789];
then i want to store the vectors in seperrately as a1=[1 2 3] or a1=[1;2;3]
a2=[4 5 6],a3=[7 8 9]
i know using loop this wil easy but with out loops is there any possible way

回答 (2 件)

Alan Stevens
Alan Stevens 2020 年 6 月 27 日
Like so:
A = [1 2 3; 4 5 6; 7 8 9];
A1 = A(1,:), A2 = A(2,:), A3 = A(3,:)

Matt J
Matt J 2020 年 6 月 27 日

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by