Hi Niles. That's not clear. What precisely are you trying to do with the matrix. Here's one:
I have to work with a large matrix in Mathematica. Instead of writing to the elements by using coordinates, i.e. [i,j], I wish to enumerate the entries starting from e.g. the lower left corner with 1, 2, 3, etc all the way up to the upper right entry.
Is there a smart way to do that? I thought of using MatrixForm on a 1D list, but I would have to split it up somehow, and I am not sure MatrixForm can do that.
My question was very ill posed, and partly because I did not understand the question I had to answer. Here is my question:
Say I have the following 3x3 grid
Each dot couples to its nearest point, i.e. point (1,1) couples to (1,2) and (2,1). Likewise, point (1,2) couples to (1,1), (1,3) and (2,2) and so on.
Now, this I express as a 9x9 matrix (1 row for each black dot, where each entry in the row describes the coupling with the other dots.) If we denote the coupling by alpha, then the first two rows in the 9x9 matrix are
Now, I wish to write a function in Mathematica, which can generate this matrix. I have tried using a primitive (i.e. ugly) way by using a bunch of "if"-statements. I did not succeed by this method, but partly because I believe there has to be a much better and efficient way.
Can you guys guide me in the right direction? I have only used Mathematica for some days now, so I do not believe I am capable of determining how to do this most efficiently. Do you have any thoughts on how to do this properly?
Very good then Niles. That is an interesting function and looks like cellular automatons right? I don't have an immediate reply but as you know Wolfram is steep in cellular automatons, got that whole book he wrote some time ago about it.
Look, here's what to do: Hook up with the Mathematica user's group. Those guys are tops. Just email your question to:
which is somehow connected with the forum at Drexel:
Math Forum Discussions - comp.soft-sys.math.mathematica
That news group and the connection to the forum is a little confusing to me but they'll know exactly what to do. I may also look at it a little but I'm nowhere as good as they are.
I think I solved the problem; at least I haven't found an example, where my code gives me the wrong result.
But I will have to implement periodic boundary conditions as well, which seems a little more difficult, so I will use your advice if it gets too confusing.