Tag Info

Hot answers tagged

6

Update: Successfully debugged!! I don't know why I do this ... This is a bug in Mathematica's MAT v4 reader that can easily be fixed on the user-side. First, let's try to do the import, which will trigger loading the .mat-importer functionality. Now let's look at the following function System`Convert`MATDump`myImportMAT4: Notice the Switch listing ...


5

Don't copy-n-paste - that's error prone, simply do it directly from the text files. Here's an example: SetDirectory["junk"]; (* create 10,000 files, each with 10,000 elements... *) Monitor[Do[RandomInteger[1*^6, 10000] >> "set-" <> ToString[n] <> ".txt", {n, 10000}], n] (* read the files, Union as we go, resulting in final result of ...


3

Being able to use this provides us with a way to produce quite secure CDFs designed for FreePlayer. Maybe it is a problem with encoding somewhere or with overloaded definitions of Get. Nevermind, as pointed out by Rolf Mertig if one uses OpenRead with DefineInputStreamMethod to convert a binary file to a stream, everything seems to work. Steps: ...


2

Here is what worked in my case: First open a new notebook. Save it to your flashdrive, into the same folder where your "csv" files are located. type in: NotebookDirectory[] Out: /Volumes/TRANSCEND/MOptics/ Now you know exactly how the filename is represented in your system. I am on a mac, thats why my filenameSeperators are represented as "/". Go to ...


2

Easy fix: Export the result in the form ExpressionML Here is the code. N[ Sum[2/10^((n*(Floor[9/n] + 1) - 9)4), {n, 1, Floor[Sqrt[ 9]]}] + Sum[ 2/(10^((n(Floor[9/n] + 1) - 9)4) (10^(n*4) - 1)), {n, 1, Floor[Sqrt[ 9]]}] + Sum[2/(10^((o^2 - o - 9)* 4)*(10^(o*4) - 1)), {o, Floor[Sqrt[9]] + 1, 10}], ((10 + 1)^2 - 9)* 4] // ...


2

The underscore _ as a pattern matching mechanism is reserved for mathematica. Therefore, either use something like dataM = ReadList[strm, Table[Record, {12}], NullRecords -> True, RecordSeparators -> {",", "\n"}]; output = Table[Flatten[{ToExpression[Drop[dataM[[i]], -1]], Last[dataM[[i]]]}], {i,1,Length[dataM]}]; or remove the underscore in your ...


1

Corrected with 2012rcampion's feedback data = Import["test.txt"] (*"(-0.000421863,1.58589e-09)(-4.04766e-05,2.67116e-07)(-8.4396e-06,-1.\ 54976e-07) (-0.000421863,1.58589e-09)(-4.04766e-05,2.67116e-07)(-8.4396e-06,-1.\ 54976e-07)"*) data = ToExpression[ StringSplit[ StringReplace[data, {","->"+I*","(" -> "", "e" ...



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