Sudoku Solver

This function will solve the standard 9 by 9 sudoku matrix
425 Downloads
Updated 12 Mar 2011

View License

Input the partially filled problem as a 9 by 9 matrix and the out put will be given.
Uses a simple greedy and back tracking algorithm.
No error correction is done so please make sure that the inputs are valid
Blank squares of the puzzle should be given an input of value zero '0'.

Sample Input:
sudoku9([1 0 0 0 6 0 0 0 0; 0 0 0 0 0 0 7 8 2;0 0 0 0 4 2 0 0 9;0 7 0 0 0 0 4 0 0;6 0 0 5 0 8 0 0 3;
0 0 8 0 0 0 0 9 0;9 0 0 7 3 0 0 0 0;2 5 6 0 0 0 0 0 0;0 0 0 0 9 0 0 0 6])

Cite As

Mathew Goonewardena (2024). Sudoku Solver (https://www.mathworks.com/matlabcentral/fileexchange/30727-sudoku-solver), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2007b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Sudoku in Help Center and MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.0.0.0