poster
2022-08-16, 07:21
<div class="content">I do not recall having seen this matrix before, but I will not be surprised to learn that somebody else already knows all about it, especially if that person's name is Nick.
Contents
Q (https://www.labfans.com/bbs/#17afe407-67a2-462b-a10b-df348fccb837)
D (https://www.labfans.com/bbs/#044996c2-78b8-4a23-a809-6ed8ab3e3607)
O.E.I.S. (https://www.labfans.com/bbs/#eca1bb02-1ba1-4bbf-9ed0-39c244e018eb)
R (https://www.labfans.com/bbs/#b7778074-8d3f-46ad-858b-13f27d2f99bd)
Condition (https://www.labfans.com/bbs/#1e78f08f-c39d-4810-93bb-b0428456710c)
Extra Credit (https://www.labfans.com/bbs/#c60c371e-4378-4499-8242-376b1b37da8c)
Q
I've been investigating the matrices generated by this elegant one-liner.
Q = @(n) (-n:n).^2 + (-n:n)'.^2;The Q is for "quadratic".
The middle column contains the squares of the integers from -n to n. So does the middle row. The apostrophe summons singleton expansion. The resulting matrix has order 2*n+1. Here is Q(5).
Q5 = Q(5)Q5 = 50 41 34 29 26 25 26 29 34 41 50 41 32 25 20 17 16 17 20 25 32 41 34 25 18 13 10 9 10 13 18 25 34 29 20 13 8 5 4 5 8 13 20 29 26 17 10 5 2 1 2 5 10 17 26 25 16 9 4 1 0 1 4 9 16 25 26 17 10 5 2 1 2 5 10 17 26 29 20 13 8 5 4 5 8 13 20 29 34 25 18 13 10 9 10 13 18 25 34 41 32 25 20 17 16 17 20 25 32 41 50 41 34 29 26 25 26 29 34 41 50I like the contour plot.
contourf(Q(100)) axis square colorbar title('Q(100)')http://blogs.mathworks.com/cleve/files/disc_blog_01.png D
For another blog post under development, I need a logical mask that carves a circular region out of graphic. This disc does the job.
D = @(n) Q(n)
Contents
Q (https://www.labfans.com/bbs/#17afe407-67a2-462b-a10b-df348fccb837)
D (https://www.labfans.com/bbs/#044996c2-78b8-4a23-a809-6ed8ab3e3607)
O.E.I.S. (https://www.labfans.com/bbs/#eca1bb02-1ba1-4bbf-9ed0-39c244e018eb)
R (https://www.labfans.com/bbs/#b7778074-8d3f-46ad-858b-13f27d2f99bd)
Condition (https://www.labfans.com/bbs/#1e78f08f-c39d-4810-93bb-b0428456710c)
Extra Credit (https://www.labfans.com/bbs/#c60c371e-4378-4499-8242-376b1b37da8c)
Q
I've been investigating the matrices generated by this elegant one-liner.
Q = @(n) (-n:n).^2 + (-n:n)'.^2;The Q is for "quadratic".
The middle column contains the squares of the integers from -n to n. So does the middle row. The apostrophe summons singleton expansion. The resulting matrix has order 2*n+1. Here is Q(5).
Q5 = Q(5)Q5 = 50 41 34 29 26 25 26 29 34 41 50 41 32 25 20 17 16 17 20 25 32 41 34 25 18 13 10 9 10 13 18 25 34 29 20 13 8 5 4 5 8 13 20 29 26 17 10 5 2 1 2 5 10 17 26 25 16 9 4 1 0 1 4 9 16 25 26 17 10 5 2 1 2 5 10 17 26 29 20 13 8 5 4 5 8 13 20 29 34 25 18 13 10 9 10 13 18 25 34 41 32 25 20 17 16 17 20 25 32 41 50 41 34 29 26 25 26 29 34 41 50I like the contour plot.
contourf(Q(100)) axis square colorbar title('Q(100)')http://blogs.mathworks.com/cleve/files/disc_blog_01.png D
For another blog post under development, I need a logical mask that carves a circular region out of graphic. This disc does the job.
D = @(n) Q(n)