Matrix element comparision ?

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 Comments

Adam Danz
Adam Danz on 13 Dec 2019
Edited: Adam Danz on 13 Dec 2019
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 on 13 Dec 2019
Edited: anshuman mishra on 13 Dec 2019
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.
Sorry i typed traversal instead of element. My bad :)

Sign in to comment.

 Accepted Answer

More Answers (0)

Products

Release

R2019b

Community Treasure Hunt

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

Start Hunting!