Hot answers tagged

8

What you are doing in (1) and (2) have nothing to do with each other. The fact that we can use the string "Byte" in both cases happens to be accidental (and I see how that can be confusing). The context, however, is different (Import vs ImageData), and thus the meaning of "Byte" is also completely different. There are many misunderstandings about how ...


7

You can use DumpSave["state.mx", "Global`"] to put all the defined variables/symbols in a given instance into a file. Then you can afterwards reload that with Get["state.mx"]. This is probably the most 'portable state' form you can get for moving a notebook's loaded data to another computer, without moving the source data.


6

As stated above, and based on MarcoB comments, I tested the workaround proposed by Simon Woods in Audio export issues, and it works: u1 = Import["AcqDev_0_6ch[ai0to5]_2500kHz_ai_000.wav"]; Block[{Rescale = #1 &}, Export["AcqDev_0_6ch[ai0to5]_2500kHz_ai_rot000.wav", u1]] u2 = Import["AcqDev_0_6ch[ai0to5]_2500kHz_ai_rot000.wav"]; Below are the first 100,...


4

GeoElevationData has elevation data for the whole world. If you know the position (I hope I interpreted correctly the wikipedia data from your link): In[]:= p = GeoPosition[{FromDMS[{42, 19, 32.}], FromDMS[{41, 51, 06.}]}] Out[]= GeoPosition[{42.3256, 41.8517}] then you can evaluate your same commands, replacing the entity by that position: data = ...


3

When working with text, you must be aware of character encodings. Today it is best practice to always use UTF-8, which is an international standard and supported by all modern software, all over the world. Be aware of what encoding your text editor uses, and try to set it to UTF-8. What happened here is that you copied the text from the website, and ...


3

You may use StringCases, StringReplace, and ImportString. ImportString[#, "Table"] &@ StringReplace[#, "<mgrwt>" ~~ Shortest[__ ..] ~~ "</mgrwt>" :> ""] & /@ StringCases[testpbkg, "<event>" ~~ dat : Shortest[__ ..] ~~ "</event>" :> dat] This gives a list with each event as a sublist. Also withStringDelete. ...


3

Alternatively: test = Import["/home/xxxxx/Downloads/dat.dat", "Table"]; b = Position[test, "<mgrwt>"]; e = Position[test, "</mgrwt>"]; l = Partition[ Flatten[Table[Range[b[[i, 1]], e[[i, 1]]], {i, Length[b]}]], 1]; test = Delete[test, l]// MatrixForm


3

Since you read the data using Table, you can treat it as matrix. here is your data SetDirectory[NotebookDirectory[]] stuff = Import["tmp.txt", "Table"]; Dimensions[stuff] So it has 28 rows To remove these rows startFrom = Flatten@Position[stuff, x_ /; x == {"<mgrwt>"}]; endAt = Flatten@Position[stuff, x_ /; x == {"</mgrwt>"}]; removeRows ...


3

I couldn't download you data for some reason, so I'll use the one in Sjoerd's answer, which I assigned to myArc. You have a number of points with inexact coordinates, so I would not rely too much on being able to compute the circumcircle. A safe method is to use the methods in this thread; the one in my answer there is quite compact: {a, b1, b2, c} = ...


3

Easy, if you have 10.0 or higher: data = Cases[ Import["D:\\Users\\Sjoerd\\Downloads\\Arco.dxf", "Graphics3D"], Line[a___] :> a, Infinity ][[1, All, {1, 2}]] {{-7.10543*10^-14, 3.42197*10^-11}, {6.90143, -3.74717}, {13.9895, -7.12801}, {21.2448, -10.1333}, {28.6475, -12.7547}, {36.1771, -14.9851}, {43.8132, -16.8183}, {51.5348, -...


2

If you look here, you get an idea where to start: DXF url="https://www.dropbox.com/s/nho1hty6ukzbnlz/Desenho%20para%20Importar%20n‌​o%20Mathematica.dxf?dl=1"; Import[url,{"DXF","Elements"}] (* {"BoundaryMeshRegion", "CoordinateTransform", "Graphics3D", "GraphicsComplex", "LineData", "LineObjects", "MeshRegion", "PlotRange", "PointData", "PointObjects", "...


2

I found the problem is with my original data; there are some unexpected Line Feed characters in my data which were causing me to misinterpret the result of "Import" using type CSV. The comments by Yode and JasonB prompted me to look at the file with notepad++ so I could see the LF characters. Sorry for the confusion.


2

Import takes all sheets, which nests the data. First@ takes the first sheet formatting the data you need for the subsequent expressions. test = First@Import["Velocidade Angular.xls"]; time = test[[All, 1]]; x = test[[All, 2]]; f = Interpolation[Transpose[{time, x}], InterpolationOrder -> 3]; Show[ ListPlot[test[[All, 1 ;; 2]], PlotStyle -> Red], ...


2

I think that's a fair answer to this topic, which doesn't really state any question precisely. Also, hard to find more authoritative source. This just isn't supported in the FrontEnd. The FE tries very hard not to put unreadable typesetting markup into packages to facilitate easy exchange with other programming editors. Possibly workarounds......


2

rawData = {{"13/12/2010", 10}, {"15/12/2010", 20}, {"17/12/2010", 30}, {"19/12/2010", 40}, {"21/12/2010", 50}, {"23/12/2010", 60}, {"13/12/2011", 80}, {"15/12/2011", 70}, {"17/12/2011", 60}, {"19/12/2011", 40}, {"21/12/2011", 50}, {"23/12/2011", 60}, {"13/12/2012", 10}, {"15/12/2012", 20}, {"17/12/2012", 30}, {"19/12/2012", 20}, {"21/12/2012", ...


2

(data = {{Date, Price}, {"16/05/2007", 3655}, {"16/06/2007", 3435}, {"16/07/2007", 3528}}) // Grid (data2 = MapAt[DateList[{#, {"Day", "Month", "Year"}}] &, data, {2 ;;, 1}]) // Grid


2

Rough mock up of how you could handle this, using Vikram's suggestion to import the data: In[4]:= lis=ReadList["yourfileName.ncol", Word, RecordLists->True, WordSeparators->{" "}] (*Out[4]= {{"0000001", "0000000", "0.4408587960080000"}, {"0000002", "0000000", "0.7405196230980000"}, {"0000002", "0000001", "0.5211728712080000"}, {"0000003", "0000000", ...


2

MMA dose not use the .wrl file format. You can use a free program called Blender. This is the site to get your free copy of blender. Click here for Blender Once it is finished installing, Import your file into Blender, and then Export the file to .3ds, And finally Import the .3ds file into Mathematica. Piece of cake


1

You could use a FileNameSetter to first select the file, then a button to import the data. For example: Manipulate[ DataModelGenerator[data1, Temperature, Rate, alphaseed, Qseed, Aseed,nseed], Row[{Item[FileNameSetter[Dynamic[selectedFile]], Alignment -> Center], Button["Import", data1 = Flatten[Import[selectedFile], 1]]}], {Temperature,...



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