New answers tagged

2

Update Using the provided files. Since the Excel files have no header, importing as a Dataset is not possible. The easiest way is to add headers to the Excel file and use the code from the comments. If that is not possible then classGrades = Import["~/Downloads/GG.xlsx"] // First // MapAt[Round, #, {All, 1}] & // (* Change class id to ...


1

use ToString and " " enclose the text. And insert blank "\ " or "\n" when we need some format. text = ToString[α + a // HoldForm // TeXForm] <> "\ " <> "a,b,c" <> "\ " <> "A+B+C"; Export["new.txt", text, "Text"] Import["new.txt"] ...


0

Make it image before exporting. Image@Rasterize@pp@12


1

Replace := by = and define a new f. Clear["`*"]; f[x_, t_] = 1/Sqrt[Cosh[r]]*((m ω)/(π h))^(1/4)* Exp[-((m ω)/(2 h))*x^2 - Conjugate[α]/ 2 (α + Conjugate[α] E^(I ϕ)*Tanh[r]) - I*ω*t - (m ω)/h E^(I ϕ) Tanh[r]* E^(-2*I*ω*t)* x^2 + (α + Conjugate[α] E^(I ϕ) Tanh[r])* E^(-I*ω*t)*Sqrt[(2 m ω)/h] x - ...


0

I tried some solutions, finally I found the best way to do; using ToString at Export and ToExpression at Import. Furtheremore, use FullForm before type casting not to export with exponential notation (then we cannnot import such data in usual way). This enable us to handle with data with any precision.


2

Update 2 This is a better implementation of the parts function that does not assume that the spacings are the same. It finds groups of rows in the image that are not composed of entirely white pixels and splits by those groups. ClearAll@parts parts[image_] := Module[{width, height, imageData}, {width, height} = ImageDimensions@image; imageData = ...


2

PDB files often contain no bond information at all, and when they do they don't contain bond types Perceiving bond types from 3D geometry is a relatively expensive operation, which is fine for small molecules (<100 atoms) but really time-consuming for large proteins The PDB importer for the "Molecule" import element does not do bond-order ...


1

For those that want to avoid mouse clicks at the expense of possibly more keypresses, postfixing //TableForm//TextCell//CopyToClipboard can be a quick fix as well: {{1, 2}, {3, 4}, {5,6}} //TableForm//TextCell//CopyToClipboard This avoids the need of selecting the output, right-clicking, and choosing "Copy As" > "Plain Text".


3

Try using ToBoundaryMesh like so: Needs["NDSolve`FEM`"]; Needs["OpenCascadeLink`"] imReg = ImplicitRegion[x^2 + y^2 - z < 0, {{x, -2, 2}, {y, -2, 2}, {z, 0, 5}}]; bmesh = ToBoundaryMesh[imReg]; bmesh["Wireframe"] shape = OpenCascadeShape[bmesh] OpenCascadeShapeExport["~/shape.stp", shape] The shape can now be read ...


2

When you ask for a big image you also need to specify a high raster resolution. Like so: eq = HoldForm[μ = (Subscript[μ, max] s^n)/(Subscript[k, s] + s^n)]; With[{size = 600}, Rasterize[TraditionalForm[eq], RasterSize -> size, ImageSize -> size]]


3

To include an eol, try this: Export["test.txt", "a\n", "Text"]


0

Alternatively, exporting and importing as a spreadsheet Clear["Global`*"] SeedRandom[1234] Generating and exporting the data Export["/Users/roberthanlon/Downloads/mydata.xls", mydata = Table[{σ, RandomVariate[NormalDistribution[0, σ]]}, {σ, 1, 2}, {100}]]; The imported data is mydata2 = Import["/Users/roberthanlon/...


1

You can use Put (>>) and Get (<<). mydata>>filename mydataImported = <<filename


3

I never used LaTex, so I decided to play with this for a while and use latexbase.com to verify the output. This is not a full solution. It works for the the provided template. Here is what it does: Allows modification of color for all text, backgroud of header row, background of first column and alternating background for subsequent columns. A \definecolor ...


3

Use ExportString in place of Export, replace the start and end of each line to form POV lists, and then export to a text file. txt = ExportString[H, "Table", "FieldSeparators" -> ","]; pov = StringReplace[txt, {StartOfLine -> "<", EndOfLine -> ">"}]; Export["lists.pov", pov, "...


Top 50 recent answers are included