Tag Info

New answers tagged

2

Solved. I changed the code to "AnimationRepetitions" -> 0 (instead of 1) and opened the gif in Chrome. It ran just once. My bad! I had not considered trying another way to open the gif. I overtrusted my gif renderer.


2

Put seems to treat the argument as literal and not evaluate it. i.e. it takes the argument filename as the actual filename and not its value. In Mathematica talk, this is called Holding its arguments. Just do this: expression >> Evaluate@filename Should work. Worked for me. Full example: SetDirectory[NotebookDirectory[]]; somenumber = 10; ...


3

Introduction There are a few ways to make such a table: (1) a symbolic way that seems conceptually clear and whose slowness is not prohibitive for a table of at most a few thousand entries; (2) using the table created by NDSolve in solving the equation by integrating its derivative either (a) directly or (b) correcting the errors in it; and (3) making a ...


2

I'll try to address this one step at a time. Since a is assigned a value of 0.022 I shall assume we will be working numerically. Let's plot our function. a = 0.022; expr = (1/2) x Sqrt[1 + 4 a^2 x^2] + ArcSinh[2 a x]/(4 a) Plot[expr, {x, -1*^5, 1*^5}] 1/2 x Sqrt[1 + 0.001936 x^2] + 11.3636 ArcSinh[0.044 x] There appear to be no complications so ...


2

OpenAppend itself does not cause newlines to be added. Only the export/write functions do. If you use WriteString, it won't add newlines. For example, s = OpenAppend["app.txt"] Do[WriteString[s, "a"], {5}] Close[s] results in a file containing aaaaa. You can include tabs using "\t".


0

If the lists are all the same length Transpose[Flatten /@ {a, b, c}] But beware that for ragged lists (i.e., those with sub-lists that are not all the same length) Transpose will not work and you have to use Flatten again. a = {{0}, {1}, {{2}}, {3}}; b = {{4}, {5}, {6}}; c = {7, 8, 9}; Flatten[Flatten /@ {a, b, c}, {2}] Transpose::nmtx: The first ...


1

The lists "a" and "b" are nested lists. With the Flatten option, the nested lists my be flattened and the nesting removed. The answer is, as posted from Öskå, to use the Flatten[]-command before the Transpose[]-command is executed.


0

This only exports output cells, but does work. SetOptions[EvaluationNotebook[], NotebookEventActions -> { {"MenuCommand", "Save"} :> Module[{loc, nb, new = FileNameJoin@Append[ Drop[FileNameSplit@NotebookFileName[], -1], FileBaseName@FileNameTake[NotebookFileName[]] <> ".m" ] }, ...


1

I contacted Wolfram Support, who replied: Thanks for your email. We actually changed the implementation of the option "OperatorSubstitution" in Mathematica 10, and now it's a global option. What happens is that the default FormatType used in graphics is "TraditionalForm", and this style has the default setting of "OperatorSubstitution" to True. To ...


5

HDF5 does not directly support complex numbers. Programs that do seem to be able to export complex numbers (like armadillo) to HDF5 will in reality split them into real and imaginary part and use their own non-standard convention for storing these. This means that while they can sometimes read back their own data, there is no compatibility between ...


4

Scale does work in strange ways. I think it is a design flaw that some transformations are only carried out during rendering (or that Normal works on Translate, but not on Scale). This makes geometric computations very awkward at times. Ah, well. The following is a horrible frankenfix to make your example work. Essentially, you need to define your own ...


1

Indeed your problem is the different image sizes Try fixing the PlotRange frames = Table[ ParametricPlot3D[ {r Cos[\[Theta]], r Sin[\[Theta]], f[r, \[Theta]]}, {r, 0, 4}, {\[Theta], 0, 2 \[Pi]} , PlotRange -> {{-5, 5}, {-5, 5}, {-15, 15}} ], {t, 1, 10, 0.1}]; Now all images are the same size. Tally[ImageDimensions /@ frames] ...


0

Implementing rhermans method, here is the code to add custom metainformation to an image under "User Comments". Then search the metainformation from multiple images to locate the image of interest according to your search terms. Creates a browser to load a file. loadImg = {FileNameSetter[Dynamic[g], "OpenList", WindowTitle -> "LoadImage"], ...


3

Even if there is some kind of mistake (typo) the solution is to use WhenEvent with Sow and Reap: {sol, {pts}} = Reap@NDSolve[{x''[t] == x[t]/(2*Sqrt[x[t]^2 + (1 - y[t])^2]), y''[t] == -0.2 - (1 - y[t])/Sqrt[x[t]^2 + (1 - y[t])^2], x[0] == x'[0] == Pi/3, y[0] == y'[0] == 0.5, WhenEvent[y[t] == 0 && y'[t] > 0, Sow[{t, x[t]}]]}, ...


2

Boardman's tutorial (now in v3) really is excellent (especially for beginners like myself) and has been updated to take into account new image processing functions in MMA v10. It's readable on a Mac using the iBooks.app bundled with OSX 10.9+ and there's also a YouTube version (though I've not had a chance to look at that yet). As to how the Manipulate ...


1

There are a number of ways to grab moving images off a screen, and for iBooks/iPad resolution, that should be plenty good, though not so much at your local iMax. Examples: http://www.screencast-o-matic.com/ http://www.movavi.com/screen-capture/


2

What I can see is that you need to include metadata in an accepted format for images, for instance EXIF. img = Image[Rasterize[x], MetaInformation -> {"Exif" -> {"ImageDescription" -> "An example", "Make" -> "camera brand", "Model" -> "xxx"}}] Export["test2.jpg", img] Import["test2.jpg", "ImageWithExif"] Options[%, ...


5

I can reproduce your problem (Win7 64, M10.0.1). Same problem if you try with PDF or EPS format. When actually your graph should look like this Graph[{1 <-> 1, 1 <-> 2}, EdgeShapeFunction -> "Line", EdgeStyle -> {Black}, VertexStyle -> Black, VertexSize -> .05] It looks like this is a bug, but there is an easy way around ...


6

If you're using Windows you can use my MathMF package (see here). It is designed for frame-by-frame import and export of video files. The code would then look something like this: frames = FileNames["*.JPG", "C:\\Users\\Simon\\Desktop\\test images"]; << MathMF` MFInitSinkWriter["C:\\Users\\Simon\\Desktop\\test.wmv", 300, 300] ...


0

I tried this in MMA 10.01 (Mac) with a simple example from the documentation: anim = Table[Plot[Sin[n x], {x, 0, 10}], {n, 5}] It doesn't look terrible but I agree that the anti-aliasing is clearly better in MMA (I had previously modified my anti-aliasing quality settings via Preferences/Appearance/Graphics). A possible reason for this is that MMA's ...


2

You can also use the built-in function Quantile without having to use Solve or FindRoot. m2 = Table[Quantile[StudentTDistribution[0, 1, df], (100 + Vertrauensintervall)/ 200.], {df, 3, 30, 1}, {Vertrauensintervall, {80, 90, 95, 98, 99, 99.73}}]; The result is identical to the one you get using the method suggested by @Sjoerd (to the deafult ...


2

Your table can be generated much easier and considerably faster using c = CDF[StudentTDistribution[0, 1, df], a] - CDF[StudentTDistribution[0, 1, df], -a] // FullSimplify m = Table[ a /. FindRoot[c == Vertrauensintervall/100., {a, 0.1}], {df, 3, 30, 1}, {Vertrauensintervall, {80, 90, 95, 98, 99, 99.73}} ]; This exports to a ...


3

Export["matrix.csv", m[[All, All, 1, 1, 2]]] should do the trick.


-3

Ended up fixing it by specifying ImageSize.



Top 50 recent answers are included