Skip to main content

# Questions tagged [conversion]

Questions on changing Mathematica expressions of one type or format to another, for example date formats, Boxes and other typesetting representations, or different units of measurements.

249 questions
Filter by
Sorted by
Tagged with
0 votes
2 answers
89 views

### Is it possible to have ToString operate on an expression containing Prefix (@) ? for example exp = [email protected]

ToString[exp] results in the string form of the evaluated form of exp when exp contains Prefix (@), such as when exp is an email address. How can such an expression be converted to a string?
6 votes
1 answer
136 views

### Help in understanding the evaluation inside Plot

My colleague sent me this surprising example of code today (this is after stripping everything unrelated to the evaluation): ...
• 542
1 vote
0 answers
59 views

### A cryptic message when converting a Graph to Graphics

In Mathematica 13.3 (Windows 11) I do Graph[{1, 2}, 1 \[UndirectedEdge] 2] then right-click on the result and choose "Convert To Graphics" from the menu ...
• 2,066
3 votes
1 answer
184 views

### Convert black and white pictures into color images

I have a digital image of an old black and white picture. Is it possible, using Mathematica, to convert this old picture into a black and white image? For example: This transformation was done using ...
• 2,855
0 votes
2 answers
104 views

### Is there a way to convert a high precision value to its digits?

Is there a way to convert a number like 2.5326384172870370602159219766864657866396178797`20.124930050805514*^-12 to a high precision integer? Mathematica gives me only 20 digits with ...
2 votes
1 answer
140 views

### Convert R code to Mathematica code of Poisson log-likelihood for the epidemic curve

I want to define a function that simulates the model for a given combination of parameters and calculates the Poisson log-likelihood for the epidemic curve of reported cases: ...
1 vote
0 answers
70 views

### Byte array to String with no internal processing, e.g. 𓃰

UTF8 defines a way to map from bytes to glyphs. In particular, glyphs with code <128 can be 1 byte, glyphs with code <2048 can be 2 bytes, etc. up to 4 bytes. For instance, the white queen <...
• 3,956
2 votes
2 answers
60 views

### ToPolarCoordinates not working with units

I am trying to convert some quantities with units from rectangular to polar coordinates (to get the magnitude and angle). It seems that ToPolarCoordinates command does not calculate the angle when ...
• 129
2 votes
1 answer
78 views

### Period to comma TexForm conversion

How can we instead of having a period as a decimal seperator have a comma when using a TeXForm conversion in Mathematica? Example: ...
• 21
10 votes
1 answer
398 views

### How to convert a Markdown file into a Mathematica notebook

How to convert a Markdown file (or text) into a Mathematica notebook? For example, easy conversion of comprehensive MSE posts is desirable. Possible approaches ordered according to their convenience: ...
• 37.9k
3 votes
1 answer
66 views

### Converting ViewPoint and ViewCenter to ViewVector

In the documentation about ViewPoint in the section "Properties & Relations" we can read: "Convert ViewPoint to ViewVector by multiplying the length and pointing the center:" ...
• 18.8k
2 votes
0 answers
59 views

### BoundaryDiscretizeGraphics for exotic unicode glyphs

This code works BoundaryDiscretizeGraphics[Text@"\[WolframLanguageLogoCircle]\[WolframLanguageLogo]", _Text] But for more exotic characters, it produces ...
• 3,956
9 votes
3 answers
1k views

### Convert four bytes to IEEE 754 float

I have some bytes, say bytes=ByteArray@{189,178,61,188}, read from a file with Import[...,"Byte"]. The big endian ...
• 3,956
13 votes
1 answer
318 views

### How to convert the ListVector into PackedArray in FunctionCompile

Cross post here I have a compile function cf to calculate the mean for a ragged list: ...
• 26.8k
6 votes
1 answer
307 views

### Convert interpolating function to a Bezier curve

I've been wondering, is there a way to convert an interpolation into a sequence of BezierCurve objects that form each step in the interpolation? There is an easy ...
• 236k
5 votes
2 answers
227 views

### Why does polygon2FilledCurve not work here?

From my previous thread where @Alexey Popkov proposed polygon2FilledCurve to remove the outline when exporting to PDF. Now I'm trying to apply that to this but it ...
• 2,390
12 votes
2 answers
633 views

### How to convert Unicode to Chinese

I want "\u5b66\u6821\u73b0\u6709\u5728\u6821\u5b66\u751f25000\u4f59\u4eba\u\ ff0c\u73b0\u5f00\u8bbe30\u4e2a\u672c\u79d1\u4e13\u4e1a" to ...
5 votes
1 answer
135 views

### Modify StandardForm of E

StandardForm of E is \[ExponentialE], can we modify it to something else? I thought I could ...
• 66.8k
11 votes
1 answer
331 views

### What is idiomatic way to extract NumericArray from Image?

It is easy to see that NumericArray is a construct underlying Image: ...
• 61.9k
4 votes
2 answers
89 views

### Format Time Reported by AbsoluteTiming

I am trying to format the timing reported by AbsoluteTiming so that it states the hours minutes and seconds of the result. However, probably because ...
• 1,981
0 votes
0 answers
85 views

### Real to IEEE 754 not working for values -1<x<1

I have written a Module that takes a real number and returns the IEEE 754 floating point binary equivalent. It works fine for values above |1|, but I cannot get it to work for inputs less than |1|. <...
• 115
5 votes
2 answers
379 views

### Exporting data from a simply generated interpolating function

The question referenced in the link here has a title that matches my question, but the discussion is very complex and does not seem to address my issue. I have solved a partial differential equation ...
• 153
1 vote
3 answers
113 views

### Converting Binary Values to Points [closed]

I searched a lot for this question but couldn't find a similar question. How can I convert my binary values to points. The output of the code I wrote is below, I wrote my expectation also below. ...
• 123
0 votes
1 answer
59 views

### How do I get 3 digits binary after calling BaseForm or IntegerDigits [duplicate]

Let's say I have a list called 'solution', I'm converting these numbers into binary form ...
• 123
6 votes
1 answer
226 views

### How to recover these TemplateBox into normal form?

I often use $\TeX$ editor by Insert→Inline TeX Input in PlotLabel to label graphics: I will get a well-formed plot label: But when I Copy As Input Text and paste ...
• 26.8k
16 votes
1 answer
507 views

### Wrong Graphics coordinate system after Image to Graphics conversion

Bug introduced in 12.3 or earlier and persisting through 13.3.1 [CASE:4896512] If I upload this image (originally this img was generated by ...
• 26.8k
1 vote
2 answers
126 views

### How can I convert dot product into Latex code without dot?

Recently I need to convert a lot of expressions containing dot products into Latex code. To my annoyance, the mathematica system will always leave literal dots (".") in the latex code, but ...
• 483
3 votes
1 answer
93 views

### Normal not working with Translate and some Graphics object [duplicate]

in v13, Normal doesn't seem to work with Translate and some Graphics objects like Rectangle ...
• 15.1k
3 votes
0 answers
79 views

### How to convert Graph atomic object back into unevaluated expression? [duplicate]

For the purposes of further development of my shortInputForm function, I wish to convert Atomic objects such as Graph into non-...
• 61.9k
3 votes
3 answers
232 views

### How to obtain a 3D matrix from Graphics3D?

I have a capillary system and I want to convert this into a numeric matrix. My aim is to create a matrix with NxNxN dimensions of 1's and 0's where the 0's represent the capillary and the 1's ...
• 1,335
3 votes
3 answers
165 views

### Exporting CSVs of UTM coordinates. How to stop northing exporting in scientific notation?

I need to batch convert a folder of CSVs containing UTM coordinates from GDA94 to GDA2020. Sample data below: Copyable form: ...
• 31
-1 votes
1 answer
120 views

### Conversion code Mathematica 5.0 to Matlab [closed]

How to convert the following Mathematica code into Matlab? What is the corresponding Matlab code? ...
2 votes
1 answer
127 views

### Python to Mathematica code bug

I have an assignment in Mathematica, which I've already solved using Python and it's a bit hard to convert the code. Here's what I have done so far: ...
• 133
7 votes
1 answer
932 views

### Convert ByteArray to integer and real values

during the import of a complex file format I handle ByteArray or lists of byte values. While I can easy transform them from one type to each other: ...
• 877
7 votes
1 answer
197 views

### Interpreting traditional math

There are two ways (afaik) to parse traditional math string to an expression: ...
• 137k
2 votes
2 answers
161 views

### Converting Strings to Reals in a List

I am new to Mathematica and working with streamed data: ...
• 89
2 votes
1 answer
227 views

### Is it possible to convert a matrix in $\LaTeX$ format to Mathematica input? [duplicate]

Is it possible to do this already in version 11.3? For example, I want to draw a graph ...
• 1,798
4 votes
3 answers
312 views

### How to convert a real number to a string only in the original length?

Example: I have this number num = 2.9525730420542016*10^1798 (* 2.952573042054202*10^1798 *) If I want to convert it to a string, I don't get "2....
• 2,989
1 vote
2 answers
183 views

### Convert GiNaC harmonic polylogarithms to HPL packages' notation in Mathematica

A general output from GiNaC (https://www.ginac.de/) of harmonic polylogarithms is H(a,b,c...,x). We want to convert it to Mathematica format (https://www.physik....
• 17
3 votes
1 answer
193 views

### How do I suppress an automatic sign change? II

Let me be try to be highly specific, as my previous attempt How do I suppress an automatic sign change? to pose the question initially had a sign error, and perhaps became a little muddled. In the ...
• 2,335
1 vote
1 answer
92 views

### How do I suppress an automatic sign change?

In a comment on the answer of user JimB to Evaluate a certain three-dimensional constrained integral , I remarked "I have a integration limit transformation rule of the form ...
• 2,335
1 vote
0 answers
360 views

### How can I convert a list of rules into a list of equations? [closed]

How can I convert a list of solutions to a list of equations? For example, say I have: sol = {{a->1},{b->2}} and I would like to change it to ...
• 711
5 votes
3 answers
817 views

### Changing value of specific element in an array. (Converting code from MATLAB to Mathematica)

Can we change the value of a specific element of an array in Mathematica? Basically, I have the following given MATLAB script which writes a big 3N-by-3N matrix $h$ by combining two 3-by-3 matrices \$...
3 votes
1 answer
74 views

### How to generate non interfering SVGs (Cloud embedded)?

The problem Please run this in the Cloud: ...
• 137k
3 votes
1 answer
69 views

### How to exclude annotation encoding='Mathematica' from generated MathML?

I do not see how to remove <annotation encoding='Mathematica' from generated MathML. Afaict it is not needed for a one way conversion and it often doubles the ...
• 137k
6 votes
3 answers
574 views

### Convert Fortran-like number form to traditional number form

What is the most elegant way to convert arbitrary numbers written as (verbatim): 1.13903 e - 08 into traditional Mathematica number form without having to ...
• 41.5k
4 votes
5 answers
2k views

### Convert decimal value to hexadecimal

How can I convert for example 62343 to a hexadecimal value 45 to a hexadecimal value ? I see I can use: IntegerDigits[62343, 16] = {15, 3, 8, 7} ...
• 2,396
3 votes
0 answers
97 views

### Is it possible to turn "FunctionResource" Notebook into ResourceObject or registered LocalObject without FrontEnd?

TL;DR The problem boils down to how to convert a correctly prepared submission Notebook into a ResourceObject suitable for ...
• 61.9k
2 votes
1 answer
741 views

### Convert Wolfram code into C language [closed]

Here is my Mathematica code: f[x_] := x^2 + 4 x + 4; Solve[f[x] == 9, x] I tried to convert it to C but failed. Here is the code for conversion: ...
• 1,671
3 votes
1 answer
165 views

### Converting Emacs Org-Mode Table to Mathematica Datastructure(s)?

Is there a way automatically/programmatically convert an org-mode table ...
• 3,145