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 vue (au cours des 30 derniers jours)
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.

Réponses (1)

dpb
dpb le 13 Déc 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.

Catégories

En savoir plus sur Shifting and Sorting Matrices dans Help Center et File Exchange

Produits


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by