How do I merge squares

1 Ansicht (letzte 30 Tage)
abdullah al-dulaimi
abdullah al-dulaimi am 30 Okt. 2022
Beantwortet: Atsushi Ueno am 30 Okt. 2022
T=
1 2
3 4
5 6
Result =
[1,2]
[3,4]
[5,6]
I want to get the result,
result will be one coluom.

Akzeptierte Antwort

KSSV
KSSV am 30 Okt. 2022
T= [1 2
3 4
5 6] ;
iwant = num2cell(T,2) ;
iwant{1}
ans = 1×2
1 2
iwant{2}
ans = 1×2
3 4

Weitere Antworten (1)

Atsushi Ueno
Atsushi Ueno am 30 Okt. 2022
It can be achieved by cell array.
T = {[1,2];[3,4];[5,6]}
T = 3×1 cell array
{[1 2]} {[3 4]} {[5 6]}

Kategorien

Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by