How to choose values from vector (150 000x1). When i need first 512 values for x, next 512 values for y and next 512 values for z. And separate vector by this style to the end
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hello everyone,
I have vector aproximatly (150 000 x 1) and i need to separate values to separate vectors (x,y,z). First 512 values of global vector is for X, next 512 values is for Y and next 512 values is for Z. And this repeats to the end of the vector. Does anyone know, how to sort values please?
Thank you so much.
0 comentarios
Respuestas (1)
dpb
el 13 de Dic. de 2021
XYZ=reshape(V,512,[]);
then process by column. Most MATLAB functions operate by column natively; depending upon what you're doing with the data, you may be able to do it all with vector operations.
NB: the "approximately 150000" elements will have to be exactly a multiple of 512 for the above to work without some bookkeeping to select the proper number overall or to augment to the next multiple.
0 comentarios
Ver también
Categorías
Más información sobre Shifting and Sorting Matrices 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!