selecting elements from an array

조회 수: 3 (최근 30일)
Nikolas Spiliopoulos
Nikolas Spiliopoulos 2017년 2월 20일
댓글: Nikolas Spiliopoulos 2017년 2월 20일
hi all,
I have an array 3x258, is there any way to create two different arrays where the first one will contain the columns that their last element is negative, and the other one the rest of them? thanks!

채택된 답변

Adam
Adam 2017년 2월 20일
idx = myArray( end, : ) < 0;
negLastElementCols = myArray( :, idx );
theRest = myArray( :, ~idx );

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Types에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by