1樓:cvgmt
r := 5;
n := 10;
meshshading =
Array[RGBColor[RandomReal, RandomReal, RandomReal] &,
Table[2, n]];
normals = Normalize /@ RandomReal[1, ];
dists = RandomReal[, n];
ContourPlot3D[
x^2 + y^2 + z^2 == r^2, , , ,
Mesh -> , , },
MeshFunctions -> (Function[, ##] & /@ (.#1 + #2 &MapThread[List, ])),
MeshShading -> meshshading, Boxed -> False, Axes -> False]
Array 先用著
如果有 2^k 種顏色,用 Partition[#,2]& 反覆分組也可以。
k = 5; colors =
Table[RGBColor[RandomReal, RandomReal, RandomReal], ]
Nest[Partition[#, 2] &, colors, k - 1]
mathematica中,如何生成下面這樣乙個離散過程的轉移矩陣?
我是這樣解決的 用1到 X1 1 Y1 1 Z1 1 的乙個數t H Y1 1 Z1 1 m Z1 1 n 1代表乙個狀態 H,m,n 然後求這樣乙個 X1 1 Y1 1 Z1 1 2的矩陣.Module prob i j Module H1 Quotient i 1,d2 d3 m1 Quotie...
Mathematica 中如何定義 f x y f x f y ?
Attributes f HoldAll f a Plus f Unevaluated a 寫完了才想起來上面這種複雜的寫法其實毫無必要。最簡單的就足夠了 ClearAll f Attributes f HoldAll f x y f x f y f a b c f a f b f c 因為Plus...
關於mathematica的問題 如何變數替換?
大灰熊 發現偏題了 不過應該沒事 去查了查,大概整理了一下這個回答。是這樣的,mma裡面的變數替換是一種模式匹配的過程,就是它會去式子裡面尋找對應的結構然後整體替換。現在的問題在於,它內部的內容和你實際上看到的內容不一樣,所以替換會失敗。比如這樣 x y z y z w 不管加不加括號都會替換失敗。...