I am trying to create a map/ path that that gets me from one point to another given a logical array
Show older comments
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.

1 Comment
Rishita
on 15 Jul 2022
C = zeros(size(B));
C(logical(B)) = A
Answers (1)
Image Analyst
on 15 Jul 2022
0 votes
This is the whole topic of Steve's blog:
Categories
Find more on Sparse Matrices in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!