Struct Field to Matrix large dataset

2 visualizaciones (últimos 30 días)
Avik Mahata
Avik Mahata el 8 de Oct. de 2021
Respondida: Dave B el 8 de Oct. de 2021
I have a strucure which has a value of the field, 20000x5x100, what it means that it has a set of 100 matrices which has, 20000 rows and 5 columns. How do I convert it to a 2000000x5 matrix printing all the 100 sets in the sequence it has been saved in the structure?

Respuesta aceptada

Dave B
Dave B el 8 de Oct. de 2021
You can use reshape but you may wish to use permute first to get things in the right order:
a=cat(3,[1 2;3 4],[5 6; 7 8])
a =
a(:,:,1) = 1 2 3 4 a(:,:,2) = 5 6 7 8
reshape(permute(a,[1 3 2]),[],2)
ans = 4×2
1 2 3 4 5 6 7 8

Más respuestas (0)

Categorías

Más información sobre Structures en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by