I am trying to create a map/ path that that gets me from one point to another given a logical array

hello all, I was trying to see if there is any way to create a path using a logical array? Basically I have a logical array that corresponds to go/nogo zones. I am trying to see what would be the best way to get from point A to point B while staying in the go zones. the map in the image is based off a logical array, where green corresponds to 1 and 0 corresponds to red, I am trying to basically get from one point to the next, while tracing the path that it took to get from one point to another while staying in the green and avoiding the red. My goal was trying to set my starting and end points and then use a for loop or something of the sorts to get from A to B. any help would be super appreciated as this has had me stuck for a while. Thank you so much.

Categories

Find more on Sparse Matrices in Help Center and File Exchange

Asked:

on 14 Jul 2022

Answered:

on 15 Jul 2022

Community Treasure Hunt

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

Start Hunting!