Randomness of magic function
조회 수: 10 (최근 30일)
이전 댓글 표시
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.
댓글 수: 0
채택된 답변
Walter Roberson
2018년 4월 7일
편집: Walter Roberson
2018년 4월 7일
magic() is not random at all. It always returns the same output for the same input. magic() constructs magic squares
댓글 수: 0
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!