Split 1x2 cells into two seperate "doubles"

조회 수: 2 (최근 30일)
Gustav Lönnblad
Gustav Lönnblad 2022년 10월 19일
편집: Voss 2022년 10월 20일
Hi! (MATLAB)
I have one cell with 1x62 and inside it 62 columns with 1x2 cells
{{1,-534},{2,-532},{3,534}.......
I and want to split them up into
[1,2,3,4....]
and
[534,-532,534....],
that is, first and second variable by them selves in a new cell.
Appreicate any kind of help, thanks :)

채택된 답변

Voss
Voss 2022년 10월 19일
C = {{1,-534},{2,-532},{3,534}};
temp = vertcat(C{:})
temp = 3×2 cell array
{[1]} {[-534]} {[2]} {[-532]} {[3]} {[ 534]}
A = [temp{:,1}]
A = 1×3
1 2 3
B = [temp{:,2}]
B = 1×3
-534 -532 534
  댓글 수: 2
Gustav Lönnblad
Gustav Lönnblad 2022년 10월 19일
Thanks alot! Appreciate it
Voss
Voss 2022년 10월 20일
편집: Voss 2022년 10월 20일
You're welcome!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Encryption / Cryptography에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by