i have a matrix:
3 0
1 2
1 4
i can find the smallest element in 1st column i.e. 1 & 0 in the second column.
I need to assign a variable as 0 for each multiple similar element in a single column i.e 1 & 1 in the 1st column & assign 1 to only one unique element in single column i.e 0 in 2nd column.

댓글 수: 3

Adam Danz
Adam Danz 2019년 12월 13일
편집: Adam Danz 2019년 12월 13일
What do you mean by assigning a value? To what? Could you provide an example of the expected output? I'm assuming you're referring to graph transversal but I can't quite picture the final output.
anshuman mishra
anshuman mishra 2019년 12월 13일
편집: anshuman mishra 2019년 12월 13일
i mean to say lets take a variable v.
Then required answer would be v =0 1 ( 0 as in multiple similar element in a single column i.e 1 & 1 in the 1st column & 1 to only one unique element in single column i.e 0 in 2nd column.
anshuman mishra
anshuman mishra 2019년 12월 13일
Sorry i typed traversal instead of element. My bad :)

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

 채택된 답변

Fangjun Jiang
Fangjun Jiang 2019년 12월 13일

0 개 추천

V=[3 0;1 2;1 4];
out=sum(M==min(M))==1

추가 답변 (0개)

카테고리

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

제품

릴리스

R2019b

질문:

2019년 12월 13일

답변:

2019년 12월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by