A GUI for helping you to solve sudoku puzzles onscreen
Updated 13 Jan 2011

View License

A GUI for solving sudoku puzzles (including those supplied by you) with various levels of help, from none (other than recording your choices and objecting to obviously wrong choices), to checking the number of solutions (which avoids struggling with puzzles that have more than one solution), to checking whether the current board has a solution, to showing in each cell not yet settled all the choices not ruled out by the basic rules, to pointing out choices that, with the present information, should be derivable or deletable (giving, optionally, more detailed information in the command window), to finishing the puzzle once only one choice is left in each of the cells not yet settled, to just printing out all possible solutions (if any), also saving the current board for later reloading, or printing it out in various ways for offline work.

As you work on more difficult puzzles, the hints can provide good training, and the checks can avoid frustration.

In standard mode, you select a particular choice by left-clicking on it, and remove one of the choices by right-clicking on it.

It is always possible to return the board to how it was just before the last change made in a particular cell, by clicking on an empty space in that cell and then clicking the resulting `undo' button (helpful when you realize at some point that you have made a mistake, or when you are reduced to trying out a guess).

It is also possible with just one click to generate, from a given puzzle, many, many new puzzles with exactly the same level of difficulty.

sudokon(g), with g a 9-by-9 matrix with all its entries taken from 0:9, will set you up to work on that puzzle.

sudokon(n), with n from 1:12, starts you off with a particular puzzle, and a subsequent sudokon(n) with the same n gives a different puzzle but of the same difficulty, with the difficulty increasing with n.

sudokon (without any arguments) starts you off with a sudoku board showing all possible choices and expects you to enter the numbers of a puzzle one by one (by left-clicking on one of the choices shown).

No claim is made that the means of checking for consistency or of providing hints are optimized but the program is actually quite fast.

Cite As

Carl de Boor (2024). sudokon (, MATLAB Central File Exchange. Retrieved .

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

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes

Fixed a bug that affects the printing of the current sudoku board (introduced during the most recent improvement of sudokon).

Size of sudokon window now constant over all platforms and screens.
'permute' button added to generate, from present puzzle, a different one of the same level of difficulty.
Some trivial mlint complaints not dealt with for backward compatibility.


Description is updated. Also, now detailed hints are optionally printed in the command window which will be of great help to those learning to play sudoku.

description is updated, improved format of optional printout in command window, cells with hints are now highlighted, use of optional second argument is avoided.