Tag Info

Hot answers tagged

6

Table[k1 + k2, Evaluate@{ToExpression[list[[1]]], 1, 2}, Evaluate@{ToExpression[list[[2]]], 1, 2}] (* {{2, 3}, {3, 4}} *) Or Table[k1 + k2, {#, 1, 2}, {#2, 1, 2}] & @@ ToExpression[list] (* {{2, 3}, {3, 4}} *)


4

On further look, your ParametricPlot expression is a bit odd. You have something like : ParametricPlot[{ f[t] , g[t] , h[r] } , {t,trange} , {r,rrange } .. ] By supplying ParametricPlot with two independent variables it thinks you want to plot regions, yet none of your functions depends on both variables. Try this: testpara[\[Alpha]_] := Show[{ ...


3

Have a look at the documentation for CSV. The first issue you have is that your file extension is .txt so Mma imports it as text file instead of a CSV file. Your second issue is that "Table" is not a supported element for either CSV or TXT so I think it is just being ignored. Even though your file does not have the .csv file type you can still tell Mma ...


2

Pick[#[[All, {1, 3}]], #[[All, 2]], 1] & @@@ grid (* {{{0, 2}, {0, 3}}, {{1, 2}, {1, 3}}} *) or (Select[#, #[[2]] == 1 &] & @@@ grid)[[All, All , {1, 3}]] (* {{{0, 2}, {0, 3}}, {{1, 2}, {1, 3}}} *) or Cases[grid, m : {{_, 1, _} ..} :> m[[All, {1, 3}]], {2}] (* {{{0, 2}, {0, 3}}, {{1, 2}, {1, 3}}} *) Update: You can also turn the ...


1

As Fred Simons comments NIntegrate has the HoldAll attribute but alone that does not explain this behavior. With the literal assignment z = 1 no NIntegrate::nlim message prints: z = 1; NIntegrate[f[x], {x, 0, z}] Table normally works by the same mechanism as Block, and indeed we see the same behavior from Block: ClearAll[f, x, z] Block[{z = 1}, ...


1

Here's an answer to the question in the comments below OP: grid={{{{0, 1, 2}, {0, 1, 3}}, {{0, 2, 2}, {0, 2, 3}}}, {{{1, 1, 2}, {1, 1, 3}}, {{1, 2, 2}, {1, 2, 3}}}} A 2x2x2 list of 3-component vectors. If I understood correctly, pick out, for example, all such vectors, that have 0 as their first component. I am inclined to take a pattern-matching ...



Only top voted, non community-wiki answers of a minimum length are eligible