Recursive Sudoku Solver in MATLAB

A Sudoku solver that takes a (9x9) matrix and outputs the solved matrix.

You are now following this Submission

This solves a Sudoku puzzle (given that it is initially valid) recursively. While it isn't the fastest, I think it's nice for 18 lines worth of code. I made another one that's faster, but it's substantially longer.

Cite As

Josip (2026). Recursive Sudoku Solver in MATLAB (https://www.mathworks.com/matlabcentral/fileexchange/44272-recursive-sudoku-solver-in-matlab), MATLAB Central File Exchange. Retrieved .

Categories

Find more on Sudoku in Help Center and MATLAB Answers

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.2.0.0

I had a look at why it was not performing as fast as I thought, turns out that setxoring is slow. So I tried to eliminate this, and it made the code ~14x faster! I've left the old code in for reference.

1.1.0.0

Just updated the title.