Tag Info

New answers tagged

0

I could not get the above to work. It put rules into the file and I just wanted values. Assuming that the Datasets holds a list of association objects as a simple table i.e. does not have multiple levels, I used Export["output.csv", ds[Values[#]&]//Normal]] Values is applied to every association object and Normal strips the head and table metadata ...


3

Starting with Mathematica 10, .mx files are only restricted by 'bitness', i.e. an .mx file generated on a 64 bit machine should be interchangeable between all 64 bit platforms (Windows-x86-64, OSX-x86-64, Linux-x86-64). Similarly, MX files generated on 32 bit platforms should be compatible with Windows-x86 and Linux-x86.


5

f[x_] := Abs@Sin@x/(x x + x + 1) a[t_] := NIntegrate[f[x], {x, t, t + 2 Pi}] tabA = Table[{t, a[t]}, {t, -3 Pi, 3 Pi, 6 Pi/100}]; opc = Sequence[ImageSize -> 400, Ticks -> {Array[- 4 Pi + # Pi &, 6], Automatic}]; Animate[Column[{ Show[Plot[f[x], {x, -3Pi, 3Pi}, AspectRatio->1/4, Evaluate@opc, PlotRange->{{-3 Pi, 3 Pi}, All}], ...


2

It took me few minutes to figure what it is doing. But here is a Manipulate. I did not know the code is there and did not look at original one yet. I am sure it is done better than my attempt here: Manipulate[ tick; If[state == "RUN", tick = Not[tick]; a = a + 0.1; If[a > 4 Pi, state = "RESET"; a = -4 Pi; cArea = {} ] ]; ...


0

One possible workaround: It turns out that low level Open/Write i/o works from an initialization file. If the output is something simple like csv you can just roll your own. f=OpenWrite["test.csv"]; WriteString[f,"1,2,3\n"]; Close[f]; ExportString and Import also do not work by the way.


1

I can reproduce something similar to your issue but I cannot fully understand why. However, if you want an alternative command, that works at least on Windows 7, here is how to do. Add the mathematica installation folder in the system's path variable. From the command line, move to the folder where the test.m file is saved (I have it in "C:\temp\") and run ...


1

NotebookSave saves a Mathematica notebook as is, without converting it to other formats. To convert to other formats, such as PDF, use Export. Example: nb = Notebooks[][[1]] Export["~/Desktop/nb.pdf", nb]


8

Mathematica has a very large number of builtin functions, most of which would be part of libraries in other languages. Many of these functions are next to impossible to implement in a compatible way, think e.g. Integrate. Mathematica is also very different from most other languages: it is based on term rewriting and operates with symbols (concepts not ...


4

I guess the rasterization into a 16 bit image is not done even though you specified the option. Does it work for you, if you use this: gr = Plot[Cos[x], {x, -4, 4}, Filling -> Bottom]; png = Export["test.png", Image[gr, "Bit16"]]; Import[png, "BitDepth"]


0

Because you are exporting as text, and when you import back into Mathematica, it will see extra commas. To get the desired default, either export as csv Export["data.csv", m1] or WDF Export["data.wdx", m1, "WDX"]


2

When you export a Table, then the array cannot be arbitrarily nested. What you should do is to export your data (which is not a matrix!) in a different format. Try: Export["data.dat", m1, "Package"] Import["data.dat", "Package"][[All, 2, 1]] // MatrixForm or Export["data.dat", m1, "MX"] Import["data.dat", "MX"][[All, 2, 1]] // MatrixForm and read the ...


0

BE HAPPY!! The easiest code is: a:= Show[PolarPlot[Cos[2 \[Theta]], {\[Theta], 0, t}], PlotRange -> {{-1, 1}, {-1, 1}}] b= ParallelTable[a, {t, 0.001, 2 Pi, (2 Pi - 0.001)/100}]; Export["4-leaved-rose.gif",b ] and the result is:


5

To realize the constant-speed drawing, you'll need to re-parameterize the equation to use the arc-length parameter: $$ \mathrm{d}s = \left\| \frac{\mathrm{d}\,\boldsymbol{\mathrm{r}}(\theta)}{\mathrm{d}\theta}\right\|\mathrm{d}\theta $$ r = Cos[2 θ] {Cos[θ], Sin[θ]} reParaEq = θ'[s] == 1/FullSimplify[Sqrt[#.#] &@D[r, θ] /. θ -> θ[s]] θFunc = ...


7

rose = Table[PolarPlot[Cos[x i], {i, 0, Pi}, PlotRange -> 1], {x, 0, 10, .1}]; Followed by: Export["rose.gif", rose] Which gives you the following beautiful animation: You can change the final number of petals by changing the number 10. You can change the speed of the animation by maing the increments smaller than .1.


8

Clear["Global`*"] f[x_, \[Theta]_] = RotationTransform[\[Theta], {1, 0, 1}, {5 Pi, 0, 5 Pi}][{x, 0, -((10 Pi)/6) Sin[x] + 5 Pi}][[{1, 3}]]; p1 = ParametricPlot[{x, x}, {x, -10 Pi, 10 Pi}, PlotRange -> {{-10 Pi, 10 Pi}, {-10 Pi, 10 Pi}, {-10 Pi, 10 Pi}}, ImageSize -> 300, Axes -> True]; n = 7; g[a_] := Evaluate[ t^(1/n) (5 a ...


5

Here's a start, the 2nd transformation is tricky for me. data = Table[{i, 0.1 Sin[100 i] + 0.7, 0}, {i, 0, 1, 0.01}]; gr = Graphics3D[{Thick, Red, Line@data}, Boxed -> False]; Manipulate[Graphics3D[ {If[t < 0.1 Pi, {Dashed, Blue, Line[{{0, 0, 0}, {1, 1, 0}}]}, {}], Arrow[{{0.5, 0, 0}, {0.5, 1, 0}}], Arrow[{{0, 0.5, 0}, {1, 0.5, 0}}], ...


1

This works for me. V 10.01 on windows SetDirectory[NotebookDirectory[]]; m = Manipulate[ Plot[phi[x, t, c], {x, 0, 20}, PlotRange -> {0, 3}], {t, 0, 4}, {c, 0, 5}, AutorunSequencing -> {1, 2}, Initialization :> ( x0 = 0; phi[x_, t_, c_] := (c/2)*(Sech[0.5*Sqrt[c]*(x - x0 - c*t)]^2); ) ] and in new cell, just type ...


2

Try some thing like this: SetDirectory[dir]; files = FileNames["*.txt"]; Export[newdir <> "\\" <> files[[#]], Cases[Import[files[[#]]], {1, _}][[;; , 2]]] & /@ Range[Length[files]]


4

As I said in the comments, you can simplify your strategy: p1 = Plot[x, {x, -7, 7} , Frame -> True , FrameLabel -> {Ω, Υ} , LabelStyle -> {FontFamily -> "Times", 14, GrayLevel[0]} , ImageMargins -> 5] You can use, i.e. specify FontFamily for your choice of font, if the font is installed on your system the font will be embedded. The ...


0

I also noticed that the "Save Graphic As..." option doesn't work very well for exporting to PDF. Maybe try exporting to an image file type like png or jpg first and then convert to PDF with an external tool. Or simply print to PDF within Mathematica:


2

I don't know how much you have worked with POVRay, but there is no need to generate thousands of individual pov files. For animations you can use the built-in clock function. Include in the graphics primitives exported by Mathematica a dependence on the clock, and let POVRay do the work for you. The following is a very simple example of POVRay code which ...


4

I would be happy if I could get Mathematica to prefix each POV-Ray export (which Mathematica supports, by the way) with a preamble in which I specify camera, lighting, etc. But unfortunately I don't know to what extent it's possible to customize Mathematica's export facilities. Use ExportString for obtaining the output file as a String inside of ...


2

First Tubify all lines Lor=ParametricPlot3D[Evaluate[{x[t], y[t], z[t]} /. soln], {t, 0, 23.23}, PlotRange -> All, PlotStyle -> Tube[.5]] next, Export["Lorenz.stl", %] etc. Then in paraview


5

The circle is not cropped when used in a Subscript: Subscript["M", "⊙"] Thus, by using this answer you can easily do: str = "This is some text with a CircleDot: " <> ToString[Subscript["M", "⊙"], FormatType -> StandardForm] If you want some Style: Style[str, Red, 20]



Top 50 recent answers are included