Tag Info

Hot answers tagged

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 ...


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 ...


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.


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}], ...


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 = ...


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}}], ...


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 ...


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"]


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.


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 ...


2

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


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 = {} ] ]; ...


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]


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 ...



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