Home Visualize the path on the 2D square
Reply: 0

Visualize the path on the 2D square

user853
1#
user853 Published in July 16, 2018, 8:21 pm

I want to visualize all of the paths on 2D square in matlab.

This code gives me the following figure which consists of a 2D square and randomly distributed of 1 and 0.

https://i.hizliresim.com/Ey4G4D.png

Each 1's must connected with lines from top to bottom.

If there is 1, then there is a way and I have to plot line. Otherwise therre is no way and stop.

Without the boundary elements, there are 3 way for each elements. Each element can go left side, right side or down side.

The top left hand corner's element can go right and down direction.

The top right hand corner's element can go left and down direction.

This is the algorithm of the modelling.

https://i.hizliresim.com/Dy0z0y.jpg

How can I write this code ?

I am waiting your advise :)

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.342007 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO