How do I merge squares

조회 수: 1 (최근 30일)
abdullah al-dulaimi
abdullah al-dulaimi 2022년 10월 30일
답변: Atsushi Ueno 2022년 10월 30일
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.

채택된 답변

KSSV
KSSV 2022년 10월 30일
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

추가 답변 (1개)

Atsushi Ueno
Atsushi Ueno 2022년 10월 30일
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]}

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by