Making a row vector from a nxn matrix

26 ビュー (過去 30 日間)
Jalal Hassan
Jalal Hassan 2020 年 6 月 25 日
コメント済み: Matt J 2020 年 6 月 26 日
I have a nxn matrix and I want to make n row vectors from that matrix.
For example, I have a Matrix
A = 3×3
1 2 3
4 5 6
7 8 9
From this, I want 3 matrices of order 1x3
B = [1 2 3]
C = [4 5 6]
D = [7 8 9]
I want this to be processed by Matlab itslef.

採用された回答

Matt J
Matt J 2020 年 6 月 25 日
編集済み: Matt J 2020 年 6 月 25 日
>> BCD=num2cell(A,2);
>> BCD{:}
ans =
1 2 3
ans =
4 5 6
ans =
7 8 9
  2 件のコメント
Jalal Hassan
Jalal Hassan 2020 年 6 月 26 日
編集済み: Jalal Hassan 2020 年 6 月 26 日
I need to save those three vectors to B, C, D vectors beacuse I have to perform convolution or polynomial multiplication to these three vectors. With num2cell, I cannot call these cells for above required function.
Matt J
Matt J 2020 年 6 月 26 日
Show me what you plan to do with B,C,D and I will show you how to accomplish ti with num2cell.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by