Randomness of magic function

Hi
I'm a bit of a newbie.
I executed the following lines in the console.
a = magic(100)
x = a(37,:)
y = a(81,:)
plot(x, y, 'go', 'LineWidth', 2, 'MarkerFaceColor', 'r', 'MarkerSize', 6)
And here is the plot.
What's with the clustering at the top-left and bottom-right, and the linear nature within those clusters? It's not a problem, just trying to understand how the randomness of the "magic" function works.
Thanks.

 Respuesta aceptada

Walter Roberson
Walter Roberson el 7 de Abr. de 2018
Editada: Walter Roberson el 7 de Abr. de 2018

1 voto

magic() is not random at all. It always returns the same output for the same input. magic() constructs magic squares

Más respuestas (1)

anroy
anroy el 7 de Abr. de 2018

0 votos

Ah, OK, got it. Sorry I should have checked the Help. Thanks Walter.

Categorías

Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.

Productos

Etiquetas

Preguntada:

el 7 de Abr. de 2018

Respondida:

el 7 de Abr. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by