Mathematica For loop in Mathematica doesn't work
- Thread starter nikolafmf
- Start date
-
- Tags
- Loop Mathematica Work
Click For Summary
The discussion centers on troubleshooting a for loop issue in Mathematica related to the use of the LinearSolve function. The primary problem arises from the incorrect formatting of the input vector, specifically the introduction of unnecessary curly braces, which leads to the kernel failing to execute properly. The solution involves using the Flatten function to eliminate these extra braces, allowing LinearSolve to process the input correctly. Documentation references clarify that while Mathematica does not require distinct formats for row and column vectors, the presence of additional braces can cause the function to misinterpret the input. By adjusting the code to remove these extra braces or by using Flatten, the for loop can run successfully without generating errors.
Similar threads
- · Replies 2 ·
- · Replies 4 ·
- · Replies 3 ·
- · Replies 5 ·
- · Replies 9 ·
- · Replies 4 ·
- · Replies 1 ·
- · Replies 4 ·
Mathematica
Numerical integration over a Green's function
- · Replies 13 ·
Mathematica
Equation of motion in Mathematica
- · Replies 1 ·