New answers tagged

2

ClearAll[foo] foo = RawBoxes[Replace[ToBoxes@#, InterpretationBox[a_, b_, c___] :> With[{aa = StringReplace[a, { "Sqrt" -> "sqrt", "Power(E," -> "exp(", "Power" -> "pow"}]}, aa], {0, Infinity}]] &; foo@CForm[D[f, M]]


2

Code: ClearAll["Global`*"]; gau[x_, v_] := Exp[-(x^2)/(2 v)]/Sqrt[2*Pi*v]; f[x_, m_, v_] = gau[x + m, v] + gau[x - m, v]; g[x_, m_, v_] = gau[x + m, v] - gau[x - m, v]; h[x_, m_, v_] := 2*Log[f[x, m, v]/f[0, m, v]] + (x^2)/v + 6 x*g[x, m, v]/f[x, m, v]; Plot[h[x, 3, 1], {x, 0, 3}] Example: *.png example Export["example1.png",Plot[h[x, 3, 1], {x, 0, 3}]] ...



Top 50 recent answers are included