Program to solve n-queens problem

The program implements short bit of backtracking and finds all solutions possible

You are now following this Submission

syntax : [sol nsol]=nqueen(n)
sol ---> solution matrix (nsol x n)
nsol ---> number of solutions found

both outputs are optional

Cite As

Saket Dandawate (2026). Program to solve n-queens problem (https://in.mathworks.com/matlabcentral/fileexchange/37420-program-to-solve-n-queens-problem), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

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