New answers tagged

3

I propose the use of ArrayComponents and Unitize: array = {{{{0, -a Sqrt[a^2 + c^2], -c Sqrt[a^2 + c^2]}, {-a Sqrt[a^2 + c^2], 0, 0}, {-c Sqrt[a^2 + c^2], 0, 0}}}, {{{0, 0, 0}, {0, -2 a^2, -2 a c}, {0, -2 a c, -2 c^2}}}, {{{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}}}; array // ArrayComponents // Unitize {{{{0, 1, 1}, {1, 0, 0}, {1, 0, ...


2

mat = {{{{0, -a Sqrt[a^2 + c^2], -c Sqrt[a^2 + c^2]}, {-a Sqrt[a^2 + c^2], 0, 0}, {-c Sqrt[a^2 + c^2], 0, 0}}}, {{{0, 0, 0}, {0, -2 a^2, -2 a c}, {0, -2 a c, -2 c^2}}}, {{{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}}} You can use f1 = Replace[#, Except[0 | _List] -> 1, Infinity] &; f2 = SparseArray[SparseArray[#]["NonzeroPositions"] ...


4

For producing a NB file without line breaks you can Get it as a Notebook expression, then Export it with PageWidth -> Infinity as "Package" (other possible options does not work correctly: Export ignores PageWidth -> Infinity when exporting as "NB" and corrupts the code when exporting as "Text"): Export["document.nb", Get["ExampleData/document.nb"], ...


3

Post-processing the DendrogramPlot output to extract the cluster distances and placing them in appropriate locations: dplt = DendrogramPlot[DirectAgglomerate[data, Style[#, 16] & /@ {"G1", "G2", "G3", "G4", "G5", "G6"}, Linkage -> "Single"], LeafLabels -> Automatic, Orientation -> Right, PlotStyle -> {Red, Thick}, Axes ...


2

You can use Row to accomplish your task. HoldForm needs to be wrapped around the first part. Copy of your code: Subscript[f, H][k_, t_] := 1/(k t + 1) Now try: Row[{ TraditionalForm[HoldForm@D[Log[Subscript[f, H][k, t]], t]], " = ", TraditionalForm[D[Log[Subscript[f, H][k, t]], t]] }] You can style it as you like. Below is a silly example ...



Top 50 recent answers are included