Tower of Hanoi
Overview
This is a class project for MATLAB Programming. (MATLAB)
- Solved the puzzle Tower of Hanoi using recursion in MATLAB.
-
Created a interactive GUI program with control components (buttons, sliders) to demonstrate the solution using animation.
toh.m
is the program with English interface.toh_Ch.m
is the one with Chinese interface.
How to Run the Program
Open MATLAB, then type the following script in the command window to start the program:
toh % 5 disks
or
toh(N) % N = 1, 2, 3,...
Demo
Here is the demo when running toh
.