How to delete the unwanted elements from a matrix based on certain assumptions of input character of 6-tuple input?

조회 수: 2 (최근 30일)
I have got the matrix of 729x6 elements. Each of the 729 elements are having 6 characters (i,j,k,l,m,n).
Also, I have certain initial conditions regarding these characters given and I want to delete the elements whose characters in the elements are not satisfying the initial conditions.
What coding, commands are required to carry out the task of applying initial conditions to the matrix of elements obtained in MATLAB?
The initial conditions include
i=0,1,2
k=1
l=1
m=1
Kindly tell. Thank you
I have attached the matrix of elements for ready reference.

채택된 답변

Walter Roberson
Walter Roberson 2017년 10월 2일
mask = ismember(ijklmn(:,1), [0, 1, 2]) & all(ijklmn(:,3:5) == 1, 2);
ijklmn = ijklmn(mask, :);
  댓글 수: 9
surabhi sachdeva
surabhi sachdeva 2017년 10월 3일
yes
But I am not getting expected outputs. I think it's might be I am taking wrong inputs for the same. I have to work upon the assumed inputs again and then try coding :(

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by