How to split 2*2 matrix into individual elements

I want to know the command for splitting the 2*2 matrix into individual elements.

1 件のコメント

Stephen23
Stephen23 2020 年 4 月 18 日
Where M is your matrix:
TL = M(1,1);
TR = M(1,2);
BL = M(2,1);
BR = M(2,2);
Note that splitting data up usually makes the data harder to work with and the code less generalized.

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

回答 (1 件)

Mehmed Saad
Mehmed Saad 2020 年 4 月 18 日

0 投票

x = rand(2,2);
x = num2cell(x);
[a,b,c,d] = deal(x{:})

カテゴリ

ヘルプ センター および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

質問済み:

2020 年 4 月 18 日

回答済み:

2020 年 4 月 18 日

Community Treasure Hunt

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

Start Hunting!

Translated by