6

I am looking for an implementation of MATLAB's numgrid function, in particular the "B" mode.

For example, I want to get the matrix corresponding to the following matrix in MATLAB:

numgrid('B', 80)
J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
Yaroslav Bulatov
  • 7,793
  • 1
  • 19
  • 44
  • 6
  • More information is needed. The linked page doesn't involve enough details about numgrid (and it's a bit surprising to me there doesn't seem to be a stand-alone document page for numgrid! ), according to this page, 'B' stands for exterior of a "Butterfly", then how is the butterfly defined? 2. Somewhat related: https://mathematica.stackexchange.com/a/43039/1871 3. Are you aware that it's not good idea to use For and AppendTo in Mathematica?: https://mathematica.stackexchange.com/q/134609/1871
  • – xzczd Jul 08 '22 at 06:18
  • 4
    The laziness is astounding. You include a couple of links I'm supposed to follow to figure out what this function does (I did not follow the links) when you should have described plainly what it does. Then you include a screenshot from some textbook that is - I guess - related to your problem, with a couple of pieces highlighted that in no way describe your problem. – Jason B. Jul 08 '22 at 13:06
  • @JasonB. sorry if this wasted your time. I sometimes start questions as placeholders for problems whose solutions would benefit the wider community, and come back later to fill in the results. The community can be quite good at mind reading :) – Yaroslav Bulatov Jul 08 '22 at 17:41
  • Well, I don't think it's good idea. Surely the community is kind. Finally there come 3 answers for an (currently) unclear question! But kindness is non-renewable. – xzczd Jul 08 '22 at 18:07
  • @xzczd Those are good answers. Having multiple implementations is good robustness check. Chances are someone else will need the numgrid function, quite a few textbooks reference it – Yaroslav Bulatov Jul 08 '22 at 18:48
  • 4
    It would be great if someone rewrote the question now that it has answers, future readers would surely appreciate clarity. – Jason B. Jul 09 '22 at 00:02
  • So did you verify your SOR implementation? – Валерий Заподовников Jul 09 '22 at 06:54