Create single dimensional array from multidimensional matrix

4 ビュー (過去 30 日間)
Anil Verma
Anil Verma 2016 年 8 月 9 日
回答済み: Azzi Abdelmalek 2016 年 8 月 9 日
I am new to matlab, so please reply even if the question is trivial
I have multidimensional matrix. Lets matrix is A
A(1,1,:) = [1 2 3] , A(1,2,:) = [4 5 6] , A(1,3,:) = [7 8 9] size(A) = 1 3 3
I want to create an array out of this matrix. I want to find all the data corresponding to A(1,1,:) in an array. Lets say the array is B
B = [1 2 3] size(B) = 1 3
How this can be done? I don't want to use loop for this operation. Is there any built in function for this?
Thanks

採用された回答

KSSV
KSSV 2016 年 8 月 9 日
B = squeeze(A(1,1,:))'

その他の回答 (1 件)

Azzi Abdelmalek
Azzi Abdelmalek 2016 年 8 月 9 日
squeeze(A(1,1,:))

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by