I have a matrix of thousands values. but i get same value in a multiple rows. i want to delete all this redundant values from this array. how can i make it?

답변 (2개)

Walter Roberson
Walter Roberson 2016년 7월 4일

0 개 추천

mask = YourMatrix(:,:,3) == 0 & (YourMatrix(:,:,1) ~= 0 | YourMatrix(:,:,2) ~= 0);
YourMatrix(mask,:) = [];

댓글 수: 2

Shamim Al Mamun
Shamim Al Mamun 2016년 7월 4일
Thanks a lot. but it says "Index exceeds matrix dimensions.". what's the problem walter.
mask = YourMatrix(:,3) == 0 & (YourMatrix(:,1) ~= 0 | YourMatrix(:,2) ~= 0);
YourMatrix(mask,:) = [];

댓글을 달려면 로그인하십시오.

Thorsten
Thorsten 2016년 7월 4일
편집: Thorsten 2016년 7월 4일

0 개 추천

B = unique(A, 'rows');
or, if you need the same order in the matrix
B = unique(A, 'rows', 'stable');

카테고리

도움말 센터File Exchange에서 Historical Contests에 대해 자세히 알아보기

질문:

2016년 7월 4일

편집:

2016년 7월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by