Split 1x2 cells into two seperate "doubles"

2 visualizaciones (últimos 30 días)
Gustav Lönnblad
Gustav Lönnblad el 19 de Oct. de 2022
Editada: Voss el 20 de Oct. de 2022
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 :)

Respuesta aceptada

Voss
Voss el 19 de Oct. de 2022
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 comentarios
Gustav Lönnblad
Gustav Lönnblad el 19 de Oct. de 2022
Thanks alot! Appreciate it
Voss
Voss el 20 de Oct. de 2022
Editada: Voss el 20 de Oct. de 2022
You're welcome!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Encryption / Cryptography en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by