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

조회 수: 2(최근 30일)
Tomas Makar
Tomas Makar 2021년 12월 13일
답변: dpb 2021년 12월 13일
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.


dpb 2021년 12월 13일
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.





Community Treasure Hunt

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

Start Hunting!

Translated by