Here's an example implementation of the A* algorithm in Matlab using object-oriented programming. We'll create classes for the nodes of the grid, the grid itself, and the A* algorithm.
main.m5207 chars187 lines
Here's how you can use the classes to find a path on a simple 2D grid:
main.m420 chars23 lines
This is just a simple example, but you can extend the classes and algorithm to more complex environments and problem domains.
gistlibby LogSnag