The Stack Overflow podcast is back! Listen to an interview with our new CEO.

# 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.

197 questions
Filter by
Sorted by
Tagged with
230 views

### How to convert numbers to currency values?

I am trying to create a way to convert some values of numbers into currency (dollars). The example I display below takes in three random numbers between -4 and 4, and rounds them to the second decimal ...
273 views

### Conversion between Piecewise[] and Abs[] representations [duplicate]

Is there a utility in Mathematica that can convert between two representations of an expression? The simplest example I can think of is Abs[x] Which I'd like to ...
59 views

### Is there a substitute for the “Show” function to use within the Mathematica kernel?

I needed to implement a function to convert an object from Graphics3D to Image3D, basically a 3D version of rasterisation (I need the geometry in a discretised form). I used the method suggested by R....
156 views

### How to restore a Notebook saved as Package?

A Notebook I was working on was saved as "Package" (with the extension ".m"). Upon opening this file, everything is unreadable. How do I convert this file back to ...
498 views

### Circle to Hexagon Conversion [closed]

I have a set of circles defined by a Middlepoint and a radius e.g. Circle1: x = 10, y = 10, r = 3 Circle2: x = 15, y = 2, r = 10 etc... But I want to have them ...
737 views

### How to use an image as a number?

How to define an image as a number? for instance I want to do something like this where but there is an error massage ...
1k views

### Display grayscale image as 3d plot

How to build 3d plot of grayscale image where x,y - pixel coordinates, z - pixel intensity? I tried ListPlot3D[ImageData[image]], but ...
146 views

### Problem with conversion of UI controllers' boxes to expressions

Bug introduced in V10 and partially fixed in V11.1.1 TLDR Various of expressions which have fancy typeset form or are designed as UI elements won't survive ...
116 views

### What types of string patterns can't be translated into regexes and hence do not work?

In a comment to related question Oleksandr R. made an interesting remark: ... because string patterns are converted into regular expressions and matched using PCRE, they are subject to some ...
151 views

### Convert expression to string in a reversible manner

What is the best way to convert an expression to a string in a reversible manner? I need a toStr function so that it is always true that ...
395 views

### How to copy formatted numbers as MathML without quotation marks?

I have the following code: a = 6.08717*10^6; b = a/3; c = a*1.5; d = a^2; matrix={{a, b, c, d},{b, c, d, a},{c, d, a, b},{d, a, b, c}}; matrix // EngineeringForm ...
166 views

### How to open and explore the codes of the system Palettes files

The built in Palettes of Mathematica are simply .nb files which can be found in the following place: ...
274 views

### How can I re-create the original Graph object from Graphics object into which that Graph was converted previously?

We can convert a Graph into Graphics very easily like it is shown in this answer. My question is: how to convert a ...
300 views

### How to convert arbitrary raw boxes directly into String?

This question is motivated by the recent question about searching inside of the NB files. According to the Documentation, ToString expects a high-level WL ...
210 views

### How to get “one Cell - one line” code format inside of NB files?

The PageWidth option controls the way the Cell's content is displayed, not the manner it's written in a ...
479 views

### Understanding evaluation and typesetting

Background So, one could be surprised by the fact that: Hold @ Grid[{{1, 2}}] (*or*) Hold @ Graphics @ Disk[] This issue and methods of prevention are ...
167 views

### Reading Cells or Boxes expression by expression

Let's say we have a cell: (*newline*) (*newline*) Plot[ x, {x, 0, 1} ] (*newline*) Plot[x, {x, 0, 2}] How to read it expression by expression? So e....
339 views

### How to convert Image3D object into Graphics3D object and vice versa?

There are some rendering options (for example, Lighting) which are associated with the Graphics3D objects. I cannot apply these ...
470 views

### How convert old version 2.2 .ma files to .nb notebooks?

I have a lot of old Mathematica version 2.2 .ma files that simply crash the current (10.4.1) version of Mathematica if I try to open them. Is there some way to ...
195 views

### ToExpression and ToBoxes aren't inverses of each other?

Applying ToExpression and ToBoxes repeatedly to Hold[1/1] gives many ...
298 views

### Can one prevent $\TeX$ conversion from changing form of expressions?

This is similar to my previous question Can one prevent operators like Factor or Apart from changing full form of some algebraic expressions? but concerns $\TeX$ and I cannot figure out whether I ...
99 views

441 views

### How to extract something from DelaunayMesh and similar family of functions

I was looking at this question here and I tried the suggested idea by Anton Antonov to use DelaunayMesh It will look like this: ...
229 views

### A bug in Rasterize?

I plot a straight diagonal line and then simply rasterize it. Consider what happens (Mathematica 8.0.4, 10.2 and 11.1.1 on Windows 7 x64): ...
85 views

### FromDigits gives “not a list of digits” error for integer string in StringExpression rule of StringCases

I have large StringExpression that is used in StringCases. Some of the parts being pulled out are integer strings. These pull ...
752 views

### Does Mathematica have an equivalent of Python's float.as_integer_ratio?

The Python programming language has a float.as_integer_ratio(x) function which exactly converts an IEEE 754 floating-point number into a numerator/denominator pair ...
46 views

### Possible bug of Exporting as HTMLFragment at Linux

This is the result of Mathematica 10.0.2 of Linux Version. There are two style inside one tag, and this fragment cannot be Imported as XML by Mathematica. This is the result of Mathematica 10.1 of ...
75 views

### How to convert a list of polynomials into a list of equations and plug into Contourplot? [duplicate]

Given a list q of polynomials (output of GroebnerBasis) in two variables I want to transform the list into a list of equations and plug it into CountourPlot. For ...
537 views

### Converting between AbsoluteTime and Unix time

By trial and error, I've found that the following gives the current Unix time: AbsoluteTime[] - UPOCH where UPOCH can be defined in any of the following ways: <...
305 views

### How can I convert a Piecewise into a nested If?

For later conversion into a programming language where if is the only conditional construct, I would like to convert a Piecewise ...
226 views

### What's real analogue for FromDigits?

FromDigits only works for integer strings. What's its real-number analogue?
115 views

### Converting path list to the nested list

I'm trying to convert the plain path list to the nested tree list like the following codes. ...
650 views

### How to convert expression with Subscript to string

I've tried ToString[], but it doesn't work properly with subscripts: How to convert expr containing subscript to a string with ...
460 views

### Decimal-to-ASCII conversion

I have to write a program that converts a number (decimal notation) to an ASCII string. For example, x = 26728 (or 0x6868) and the string is "hh". I wrote this, but it seems that it is not the ...
208 views

### ConversionRules and style inheritance

Take the LaTeX-Article stylesheet stylesheet = FileNameJoin[{"Article","LaTeX-Article.nb"}]; Compare these outputs ...