how to form a matrix with non-repeated values?

7 views (last 30 days)
Hello every one,
I am trying to find a node matrix of specific route char. from sorce to sink but without repeating a node. the attached m.file I used but it repeats nodes. can you help me modify it not to repeat elements in matrix r?
  5 Comments
Image Analyst
Image Analyst on 3 Dec 2022
Wow Dina, you're really making it difficult for people to help you. Why? Why not make it easy for people to help you instead of hard? Can't you do as Torsten asks? Please attach your whole m-file with the paperclip icon. And if there are anything you need to input interactively, say what those values are.
Dina Emad
Dina Emad on 4 Dec 2022
sorry for that, I have edited the question and added the m-file.

Sign in to comment.

Accepted Answer

Image Analyst
Image Analyst on 3 Dec 2022
Maybe shortestpath perhaps?
Or, maybe use bwdistgeodesic(). See Steve's blog series:
  2 Comments
Dina Emad
Dina Emad on 4 Dec 2022
Thank you, it is working.
I have got the mistake in my code but I couldnot fix it
in the line of ( [vn,posn]=min(a(a>a(npos(pos)))))
he is ordering the values based on the condition inside brackets..i.e. he will arrange the values more than npos(pos) from 1 2 3...

Sign in to comment.

More Answers (0)

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Products


Release

R2019b

Community Treasure Hunt

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

Start Hunting!