Randomness of magic function

11 Ansichten (letzte 30 Tage)
anroy
anroy am 7 Apr. 2018
Beantwortet: anroy am 7 Apr. 2018
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.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 7 Apr. 2018
Bearbeitet: Walter Roberson am 7 Apr. 2018
magic() is not random at all. It always returns the same output for the same input. magic() constructs magic squares

Weitere Antworten (1)

anroy
anroy am 7 Apr. 2018
Ah, OK, got it. Sorry I should have checked the Help. Thanks Walter.

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by