File Exchange

image thumbnail

Sudoku Solver

version 1.0.0.0 (1.95 KB) by Mathew Goonewardena
This function will solve the standard 9 by 9 sudoku matrix

1 Download

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 (2021). Sudoku Solver (https://www.mathworks.com/matlabcentral/fileexchange/30727-sudoku-solver), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (0)

MATLAB Release Compatibility
Created with R2007b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories

Community Treasure Hunt

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

Start Hunting!