Tag Info

Hot answers tagged

6

Will a = -3; Print[Defer[\[FormalA] x + 5 + x^2] /. \[FormalA] -> a] -3 x + 5 + x^2 work for you?


6

x = {3, 1} y = {2, 5} a Defer[x] + b Defer[y] /. First@Solve[a x + b y == {7, 11}, {a, b}] (* x + 2 y *) Note that the output is usable as such: evaluate it and you'll get the combination result. If only integer coefficients are desired, changing the Solve to something like: Solve[a x + b y == {7, 11} && {a, b} \[Element] Integers, {a, b}] ...


5

Go To Format > Edit Stylesheet... and add this style to your private stylesheet: Cell[StyleData["Output", "SlideShow"], ShowCellLabel->False]


4

What about Print[HoldForm[3 x + 5 + x^2]] ?


3

Yes, there is such a way. Try this, for example. First define a function to integrate; int[expr_] := Integrate[expr, {z, -h/2, h/2}, {\[Theta], 0, 2 \[Pi]}] Then map this function onto the terms of your expression: r[\[Theta], z] = Sqrt[(h/2)^2 - z^2] + g[\[Theta]] - h/2; Map[int, Expand[1/2 r[\[Theta], z]^2]] This results in: $$\int_0^{2 \pi } ...


3

pp = {{rr, {{0, t, q, dh}, {0, 1, 0, th}, {1, 1, 0, sh}}, {{0, t, q, dh}, {1, 0, 0, th}, {1, 0, 0, sh}}}, {kk, {{0, t, q, dh}, {0, 1,0, th}, {1, 0, 0, sh}}, {{0, t, q, dh}, {0, 0, 0, th}, {0, 1, 0,sh}}}}; MapAt[MatrixForm, pp, {{All, All}, {}}]


3

Let's define your matrix as p = {{rr, {{0, t, q, dh}, {0, 1, 0, th}, {1, 1, 0, sh}}, {{0, t, q, dh}, {1, 0, 0, th}, {1, 0, 0, sh}}}, {kk, {{0, t, q, dh}, {0, 1,0, th}, {1, 0, 0, sh}}, {{0, t, q, dh}, {0, 0, 0, th}, {0, 1, 0,sh}}}}; You could do the MatrixForm on the outermost and the inner levels: #[Map[#,p,{2}]]&@MatrixForm An ...


3

For the record: You can do this via Edit/Preferences/Messages:


3

Do[ Check[{i/i, 1/(i - 5)}, Print@i], {i, -10, 10}] // Quiet 0 5


2

Assuming you are asking about polynomials only (where exponents are integers from definition) with real coefficients: expr = 0.2134320980 x^2 + 0.0023432 x + .2 x^3; (HoldForm[#] &@expr) /. c_Real :> NumberForm[c, {∞, 3}] 0.002 x + 0.213 x^2 + 0.200 x^3 You may use one of the methods introduced here: 20714 to preserve traditional order: f = ...


2

a = 0.2134320980 x^2 + 0.0023432 x; a /. Times[b_, c_] :> Times[Round[b, 0.0001], c] 0.0023 x + 0.2134 x^2


2

"Show In/Out Names" in the Edit menu -> Preferences under "Evaluation".


2

I am not sure of your level of Mathematica experience, or the context of your need. Some basic facts about Mathematica may be helpful. Mathematica sorts output lexicographically (roughly alphabetic order). So if you have a choice of variable names make all of the complex coefficients later in the alphabet than the real coefficients. e.g. ComplexExpand[a ...


2

EDIT Here's a slightly modified version of a suggestion made by Kuba in my separate question on this topic (coordinates[[1]] /. (Sqrt[5]) -> (2 tau - 1) // Simplify) /. tau -> HoldForm@\[Tau] ORIGINAL This is not the most elegant solution to grace this forum, but: Map[ If[ AtomQ@#, #, (Simplify[#/τ]*HoldForm@τ) /. { τ -> ...


2

Use this Monitor[ For[i = 1, i <= n, i++, ... If[Mod[i, stride] == 0, t = {N[i/n], bestsofar}] ],t]


1

Try using Pane, e.g. (I used a random chunk of equation for example here): Pane[TreeForm[(Abs[(mod - q2)*(q1 - lent*totalt)] + Abs[q2*(1 + q1 - lent*totalt)])/totalt, ImageSize -> 1000], ImageSize -> {600, 400}, Scrollbars -> True]


1

Format[Den[n_, OutputForm]] := "D(" <> ToString@n <> ")" Format[Den[x_], StandardForm] := 1/x^2; Den[x] 1 / x^2 Den[x] // OutputForm D(x) $Post = OutputForm Den[x]*Den[y] + Den[x]*Den[z] D(x) D(y) + D(X) D(z) $Post =. Den[x]*Den[y] + Den[x]*Den[z]


1

Maybe this can help you: x = ""; InputField[Dynamic@x, String, ContinuousAction -> True] Dynamic@InputForm@x


1

It was treating the "=" as a string that caught me off guard. NotebookWrite[InputNotebook[], Cell[BoxData[ RowBox[{MakeBoxes[string], RowBox[{"=", "\"", ToBoxes@Placeholder[enter here], "\""}] }] ]] ]


1

Another approach: a = Table[{i/i, 1/(i - 5)}, {i, -5, 5}] // Quiet {{1, -(1/10)}, {1, -(1/9)}, {1, -(1/8)}, {1, -(1/7)}, {1, -(1/ 6)}, {Indeterminate, -(1/5)}, {1, -(1/4)}, {1, -(1/3)}, {1, -(1/ 2)}, {1, -1}, {1, ComplexInfinity}} DeleteCases[a, {___, Indeterminate | ComplexInfinity, ___}] {{1, -(1/10)}, {1, -(1/9)}, {1, -(1/8)}, {1, ...



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