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 (최근 30일)
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.

답변 (1개)

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

카테고리

Help CenterFile Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기

태그

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by