Tag Info

Hot answers tagged

3

You For syntax is just wrong. Try r = Range[10] For[i = 1, i <= 9, i++, k = Complement[r, {i, i + 1}]; Print[k]] and avoid capital letters for your symbol names. K has a build-in meaning Information[K] K is a default generic name for a summation index in a symbolic sum.


2

Yes. But don't assume that the vertex named 1 is the first one, etc. That is often not the case. You can get the order of vertices using VertexList. You can get the index of a certain vertex using VertexIndex.


1

A For-loop is a poor choice for your calculation in Mathematica. Better, because it's simpler and faster, is sets = Table[Complement[Range[10], {i, i + 1}], {i, 9}]; which has the additional advantage that the results are available for further calculations. To get the results printed out nicely, use Column Column @ sets


1

Changing B*list to B.list seems to solve the problem. Also, I recommend dropping unnecessary decimal points from myfun14. Doing so gives (* {x[1] -> 0.5, x[2] -> 0.273438, x[3] -> 0.0128174, x[4] -> 0.125601, x[5] -> 0.00588754, x[6] -> 0.000275978, x[7] -> 0.0000129365, x[8] -> 0.0625006, x[9] -> 0.00292972, x[10] ...



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