Page 1 sur 1

MAGIC() cmd

Publié : ven. févr. 08, 2019 5:08 pm
par compsystems
The matlab documentation uses the MAGIC() command a lot. It seems that the thrown matrix has special properties, please, you can replicate this cmd.

Thank you

Code : Tout sélectionner

for n = 1:16
    subplot(4,4,n)
    ord = n+8;
    m = magic(ord);
    imagesc(m)
    title(num2str(ord))
    axis equal
    axis off
end
https://la.mathworks.com/help/matlab/ref/magic.html


Image