This Challenge is to demonstrate usage of varargout.

Output a cell array using varargout of magic squares of size 1 thru n.

Input: n, Number of magic squares. Squares are of size 1:n

Output: m_out, a cell array of n magic arrays

n=3

m_out{1} = [1] ,

m_out{2)=[1 3;4 2];

m_out{3}=[8 1 6;3 5 7; 4 9 2]

This Challenge is based upon a varargout implementation in Alfonso Castanon's top entry in the Knot's Challenge, lasttry05

Solution Stats

117 Solutions

76 Solvers

Last Solution submitted on Feb 20, 2026

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...

Problem Recent Solvers76

Suggested Problems

More from this Author308

Problem Tags

Community Treasure Hunt

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

Start Hunting!