Tag Info

New answers tagged

0

Although this may not be the best answer, it seems to work for me. Since I don't want to change the permissions of the existing directory to allow Mathematica to write to it, but I want to be able to have those files accessible from that directory, I am making a symbolic (soft) link between the directory in /home/pi/ to the target directory by doing the ...


2

This times about 65% higher than Leonid's on my machine. But maybe a more naive answer might be useful to some. Module[{rBytes}, (* Returns the next numbers or $Failed *) read[str_InputStream] := rBytes[str, BinaryRead@str]; rBytes[str_, n_Integer] := BinaryReadList[str, "Byte", n]; rBytes[_, EndOfFile] := $Failed; ] (* Some usability defs *) ...


3

General Here is my suggestion: if you have enough RAM (which may well be the case, given that your files are not in GB range), it will likely be faster to load the file into memory at once, and then split into groups of bytes. Note however, that since at the moment there isn't a top-level byte array representation in Mathematica which would be easy to work ...


0

Please try this code: x := 2 z := 1 v := 0.98 T := 10 dt := T/1000 Table[ y /. Solve[-T/2 + i*dt - y == Sqrt[x^2 + (z - v*y)^2], y][[1]], {i, 0, 999} ] {-300.33859829722434`, -299.8391603699061`, -299.3397243096371`, -298.8402901257249`, . . ., 2.506139642749351`, 2.5124784155139106`} You should be able to Export that as a plain list of numbers. ...


1

If you put the MMA file inside "samefolder" directory then: SetDirectory[NotebookDirectory[]]; StringTake[#, {1, -4}] & /@ FileNames["*AB", "", Infinity] (*{"A01\\122", "A03\\124", "A04\\125"}*)



Top 50 recent answers are included