필터 지우기
필터 지우기

Split array in subarrays According to condition

조회 수: 15 (최근 30일)
SmaShBr0ther
SmaShBr0ther 2018년 6월 11일
답변: Robert U 2018년 6월 12일
Hello everybody,
I'm currently trying to split an arrays into multiple sub-arrays. I have a 10500000x2 array an I need data from column 1. in Column 2 there are just 1s and 2s that form some kind of puls signal. I now want to have a subarray for each "pulse" where column2 is equal 2. I added the matrix and hope I was able to express my problem.
Thanks

답변 (1개)

Robert U
Robert U 2018년 6월 12일
Hi SmaShBr0ther:
The requested functionality is obtained by logical indexing
Applied to your example file:
subarray = Example(Example(:,2)==2,:);
Kind regards,
Robert

카테고리

Help CenterFile Exchange에서 Array Geometries and Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by