Array slicing scattered rows

조회 수: 2 (최근 30일)
AMIT PAWAR
AMIT PAWAR 2020년 4월 26일
답변: Ameer Hamza 2020년 4월 26일
How can I select scattered rows from an array? Suppose
A = rand(6,6)
now how can I select everything except the second and fifth row of A?

채택된 답변

Ameer Hamza
Ameer Hamza 2020년 4월 26일
You can use setdiff()
A = rand(6,6);
idx = setdiff(1:size(A,1), [2 5]);
B = A(idx, :);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Scatter Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by