I have a matrix, and I want to multiply all the values in each element by Sqrt[2/3]. Here is the code.
m = Table[
If[(n)^2 + (j)^4 + (k)^3 + (l) == 0, {n, j, k, l}, Nothing], {n,
0, 10, 1}, {j, 0, 10, 1}, {k, -10, 0, 1}, {l, -10, 0, 1}] //
Flatten[#, 3] & // Select[Length@# > 0 &]; m // MatrixForm
So the columns of the matrix correspond to the values of (n,j,k,l). Now I want to create a new matrix, where I introduce a counter value that starts at say 0.01 and increments by 0.01 with each iteration, call it a++.
The new 3 column matrix will take the value of (n,j,a) and put it into the matrix as the first row, and also (while keeping the same value of a) will also add (k,l,a) as the second row and then move the next row of the original matrix and so the same process, with the counter a incremented.
This code, with the help of people here, is:
Join @@ MapIndexed[Partition[#1, 2] /. x_?VectorQ :> Join[x, 0.01 #2] &, m]
ListPlot3D[%, PlotStyle -> PointSize[0.02]]
However, before plotting this, I want to also update each element of the value of a to the value of a times 1/Sqrt[3].
The previous post is here: Create a new matrix from an existing matrix and then plot it
Any help would be appreciated.
ListPlot3D[% / Sqrt[3], PlotStyle -> PointSize[0.02]]
? $\endgroup$