Tag Info

Hot answers tagged

6

data = Table[(i + j) i (i - j), {i, 1, 2}, {j, 1, 22}]; The first step is to define a function to break up each row in the data into lines not exceeded the specified maximum line length. prep[row_, fieldWidth_, lineLength_] := Module[{items = Floor[lineLength/fieldWidth]}, Partition[row, items, items, 1, {}]] The second step is to do the ...


4

I believe this is what you're seeking: HoldForm[foo] /@ Range[2] and if you want individual elements: (HoldForm[foo] /@ Range[2])[[1]] and (HoldForm[foo] /@ Range[2])[[2]]


4

You can use $PrePrint to achieve this: $PrePrint = InputForm; Now every output will be preprocessed by InputForm before it is printed. Use $PrePrint =.; to restore the default behavior. You could also use $Post instead of $PrePrint. However, when $Post is used you'll get Null as an output when there normally is no output, e.g. if the input ended with ...


3

Here is a simple way to do it usingMulticolumn, which is new in V10. I use a 4 x 4 grid with a list of three pictures Multicolumn[ Item[PopupWindow[#, #, WindowSize -> {All, All}], ItemSize -> 10] & /@ pictlist, 2, Frame -> All] And clicking on one the thumbnails produces


3

GraphicsGrid[ Partition[ Join[PopupWindow[#, #] & /@ pictlist, ConstantArray["", Mod[Length@pictlist, 8]]], 8], Frame -> All, ImageSize -> 800]


2

Quick fix is to use Pane[#, ImageMargins -> {{0, 10}, {5, 5}}] & on tabs contents. Not convenient but working. Probably also OS dependent solution... To not copy this I'm using a function which can be used directly on TabView: tabViewFix1 = Function[tabView, MapAt[ Pane[#, ImageMargins -> {{0, 10}, {5, 5}}] &, ...


2

You need to correct two errors : Replace Log(...) by Log[...] Replace e by E Then deltaG[1] returns -86.6838


2

You can also use "FrameStyle"->Thick in Version 10: ContourPlot[y - x^2, {x, 0, 1}, {y, 0, 1}, ContourStyle -> Directive[Thick, Black, Opacity[1]], FrameStyle -> Thick, PlotLegends -> BarLegend[Automatic, "FrameStyle" -> Thick]] In Version 9 (Windows 8 x64) BarLegend[Automatic, "FrameStyle" -> Thick] renders only three sides of the ...


2

Here's a small example: image := Graphics[{Hue@RandomReal[], Rectangle[]}, ImageSize -> 50] images[n_] := Partition[PadRight[Table[image, {n}], n + 8 - Mod[n, 8], Null], 8]; The key is that Null gives a blank space when used in GraphicsGrid. I agree with Zviovich that PopupWindow is the best way to achieve what you ask for when it comes to displaying ...


2

You can write a function that processes the boxforms produced by TraditionalForm to replace the parentheses by square brackets: tF=RawBoxes[ToBoxes[TraditionalForm[#]]/.{"("->"[",")"->"]"}]&; TraditionalForm/@{C[x,y], Sin[x], f[x,y], H[x], h[x,y,z], H[x,y], h[{x,y}]} (* {C[x,y], sin(x), f(x,y), H(x), h(x,y,z), H(x,y), h({x,y})} *) tF/@{C[x,y], ...


2

The reason is, that the nicely formatted subscripts in the frontend looking like $c_f$ are no "real" variables, but are represented as Subscript[c,f]. You can see that, if you use FullForm on one of those subscript-lookalikes. Therefore, your code does end up trying to create the derivative of the Mathematica-function Subscript, but of course there is no ...


1

I can't get Alexey's solution to work on Mathematica 10, so I use this custom function to output simple strings in lieu of PutAppend: myPutAppend[string_String, pathtofile_] := Module[ {f}, f = OpenAppend[pathtofile]; WriteString[f, string <> "\n"]; Close[f] ] The \n bit is needed because WriteString does not automatically add it to the end ...


1

Adding a semicolon at the end of your command will suppress its output. result = Solve[...]; The result is saved in the variable result for further processing. You can get the constants by, for example, constant1 = C1 /. result;


1

Only way I know about is to use sol = D[Log[Sin[x]], x] TrigFactorList[sol] The second term in each list is the power. So you read the above as $\frac{\cos x}{\sin x}$ reference


1

Since you want Mathematica to perform some simplifications of your expression, I don't think this is purely formatting question. Inferring from your desired simplifications of $\rho^i\omega\rho^{-i}$ for different $i$, it is supposed to be some form of multiplication, but different than built-in Times function. I would start with defining desired ...


1

formatter[fab_, c_] := Block[{p1, p2, lhs, rhs, fn}, rhs = If[fab == 0, Subscript[\[Omega], c], If[fab < 0, fn = Abs[fab]; HoldForm[\[Rho]^-f Subscript[\[Omega], c] \[Rho]^f] /. f -> fn, HoldForm[\[Rho]^fab Subscript[\[Omega], c] \[Rho]^-fab]]]; lhs = Subscript[W, fab][c]; Replace[Evaluate[{lhs, rhs}], List[a__, b__] :> ...



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