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.

Filter by
Sorted by
Tagged with
8
votes
1answer
90 views

DateObject granularity conversion

Is there a way to convert the DateObject whose FullForm is: ...
5
votes
2answers
123 views

Convert String to Integer from a huge string database in a very fast way?

I have a huge string database with the form such as {{position},{1,2,3,4,5,..}}, and I want to convert such database to Interger data in a very quick way. In the following example, I created a ...
2
votes
1answer
109 views

Is NumberForm double rounding numbers?

A number like 0.644696875 is represented internally as 0.6446968749999...: N[FromDigits[RealDigits[0.644696875, 2], 2], $MachinePrecision] (* 0.6446968749999999 *) ...
2
votes
0answers
67 views

Notebook (.nb) → Jupyter (.ipynb) conversion without Mathematica?

Is there a way to convert Mathematica Notebook files (.nb) to Jupyter files (.ipynb) without using Mathematica?Is there a free online utility or other piece of software that can do this?
1
vote
1answer
47 views

Convert string to conditional operator

I have a RadioButtonBar with a selection x = None; {RadioButtonBar[Dynamic[x], {lt, le, eq, gt, ge}], Dynamic[x]} Once a radio button is selected, I would like ...
8
votes
1answer
103 views

Errors in converting LaTeX using ToExpression

I am trying to write a function which takes Maple Latex generated, feed it to Mathematica, use ToExpression then convert it back to Latex. This is because ...
5
votes
3answers
180 views

Convert graph format for Mathematica graph functions

I have an output of many large graph files, specified by pair of vertices, in a format like ...
0
votes
0answers
22 views

Export HTML + MathML is skipping some math. Why? How to fix?

Using Mathematica's HTML export feature with MathML often skips some expressions, instead rendering them as plain HTML instead of MathML. Probably, in the options there is a way to force it, but how? ...
9
votes
4answers
238 views

How can one convert an expression to a string while keeping the quotation marks of strings that are part of the expression?

How can I for example convert {"a","b"} to "{\"a\",\"b\"}", so keeping the quotations marks.? I tried ...
9
votes
3answers
398 views

Create Array from list of indices/values

Is there is a performat way to convert something like {{0,0},a},{{0,1},c},{{1,0},d},{{1,1},e} into {{a,b},{c,d}} The ...
6
votes
1answer
98 views

TeXForm doesn't work in wolframscript?

Consider that $ wolframscript -cloud -code 'TeXForm[ (d u)/(d t)]' TeXForm[u/t] yet I don't have a local wolframscript kernel installed. Is this something ...
3
votes
0answers
38 views

Efficient conversion of a ByteArray object into a hexadecimal string

What is the best way to convert ByteArray objects into hexadecimal string representation? Although the following works, I find it questionably awkward (and likely ...
0
votes
1answer
67 views

How do I treat polynomials as vectors?

From time to time I find myself in the following situation. I have generated a list of polynomials from some ring $R=\mathbb R[x_1,\ldots,x_n]$ and now I wish to view these polynomials as vectors in ...
0
votes
0answers
42 views

How to convert {x -> 4} to simply 4? [duplicate]

I am using the Solve function to obtain two solutions for a quadratic, then I want to use those two solutions as input for something else but I can't because they are in the form of (x->number} ...
1
vote
1answer
51 views

How to encode the character into UTF-8?

As we know the café is caf\xc3\xa9 after encode by UTF8: >>> 'café'.encode('utf8') ...
0
votes
0answers
28 views

Programmatically get InputText of box structure without spaces

I am looking for a way to get something similar to the "Input Text" form of an arbitrary box structure, but without the extra whitespaces. Before I explain the requirements in a bit more detail, let'...
0
votes
0answers
68 views

A way to calculate colour from wavelength?

I'm trying to create a script taking my experimental values of measured radiance and turn it into xyz and rgb colour values. I import table with colour matching functions from here -http://cvrl.ucl.ac....
5
votes
3answers
119 views

Specify set of base units to use in UnitConvert

I am trying to convert arbitrary units to CGS. I know this can get a bit tricky with ESU, but for this question that does not need to be addressed. What I would like to do is to give a quantity-to-...
4
votes
1answer
62 views

Is there any way to turn Labeled[…] into graphics primitives?

I have asked a similar question before. In that question I pointed out that the following code does not work: ...
2
votes
1answer
397 views

Converting built-in Mathematica symbol to C [closed]

I am trying to convert my Mathematica code to C since it can sometimes takes the Mathematica code quite a while to execute since the arrival times lists are hundreds of thousands of counts long, and ...
0
votes
0answers
82 views

How to extract the code from a cdf file? [duplicate]

I have several CDFs, and these bring interactive drawings with functions, how can I extract the code that generates them? I have tried to follow some previous answers but it does not work for me, it ...
2
votes
1answer
130 views

Convert ASCII Characters to Mathematica Input Form

I have the following pure ASCII character list: ...
1
vote
1answer
46 views

Convert Part of Subscript Files to Math Form

I have french subscript file here: https://uploadfiles.io/iehon If you download it an open it with Word, you can see that the math sections are but between $<i>$ and <\i>: To import the ...
2
votes
1answer
67 views

Convert RotationMatrix to RotationTransform

Is it possible to convert RotationMatrix to RotationTransform ? I guess it should exist a function to do this Thank you for ...
4
votes
1answer
91 views

Problem using UnitConvert

As we know in physics, power = torque * (angular velocity). But when I use UnitConvert to convert a quantity expressing power/(angular velocity) into newton-meters, ...
1
vote
3answers
93 views

How to convert DateList format to standard SQL format?

I have a date in standard SQL format YYYY-MM-DD HH:MM:SS.xx, where the xx are hundredths of seconds: x = 2016-05-30 11:58:46.84 I have a file with 200,000+ ...
5
votes
6answers
265 views

How to convert a list of digits to a string in Mathematica

I want to convert a list of digits to a string, for example from {1,2,3,4,5}, I want to get the string 12345. The following will work as long as the list does not ...
4
votes
1answer
93 views

Points in CIE Lab color space

The following points are Lab values (CIELAB color space) points={{46.76, 34.51, 17.08}, {43.51, 34.83, 15.7}, {45.49, 32.92, 15.24}} what I would like to do is a) ...
2
votes
1answer
100 views

TeXForm of symbols

For reasons unknown, TeXForm seems to produce different results when acting on symbols that are one character long versus longer characters: ...
4
votes
2answers
182 views

How can I plot the price of Bitcoin since last week?

What is the best way to plot the price AND volume of Bitcoin (or any other currency) in USD for the past week/month/year? Is it a good idea to use CurrencyConvert? ...
1
vote
3answers
123 views

Multiplying quantities by scalars in Mathematica 11.3

I'm no longer able to multiply scalars by quantities in Mathematica 11.3. In previous versions the code 3*Quantity[1, "mm"] evaluated to ...
0
votes
0answers
220 views

Convert Mathematica Code to R Code

I would like to convert Mathematica code to R code. For example, 4/(-1 + δ) + (-1 + δ) Subscript[P, R] The above is a copy version from Matematica. But I would ...
2
votes
2answers
131 views

Extraction of array from NDSolve output

I have got a system of differential equations. The system has $4$ variables. I am trying to plot trajectory of a particle outside a Kerr Black Hole. I have used Mathematica to calculate all the $4$ ...
10
votes
2answers
225 views

Schrödinger's MatrixForm: feature or bug?

Recently I noticed a peculiar behavior of MatrixForm that I failed to find a way to explain. Consider the following example: ...
4
votes
1answer
129 views

The algorithm behind InputForm for machine numbers

There are several questions on this site about implementing fast CSV/TSV export for machine numbers without loss of precision. Recently I discovered that Export ...
5
votes
1answer
79 views

Convert a numerical expression to words

I would like to convert algebraic sums of the form 8+1-3 into words, obtaining "eight plus one minus three". I have tried using ...
13
votes
1answer
190 views

Safe alternatives to ToExpression

Background Conversion from string/boxes to expression is quite common. Very often the goal would be a simple switch from "1" to ...
1
vote
1answer
56 views

How to convert cdf to stl format

I have the CDF version of the file that i need to 3D print, and because it wont let me convert to an STL format the normal way, how can i convert it.Is there a format i can convert it to, then open it ...
7
votes
2answers
225 views

How to convert dayname to number?

When I input DayName[{2012,12,24}] I get Monday as output. What is the most effective way to convert Monday into 1, Tuesday into ...
1
vote
1answer
70 views

Is there a function to convert an English description to an expression?

I know I can write: SpokenString[a + b^2] And then obtain as output: "a plus b squared" What about the opposite, something ...
4
votes
1answer
53 views

Unable to convert degree to number in LatitudeLongitude and “City” Entity

I am trying to convert degree to number for some mathematical transformation. Taking London as an example, the following codes can convert the degree into a number without any problems: Codes that ...
0
votes
0answers
37 views

Using Rationalize to find the exact rational form [duplicate]

When I run Rationalize[2.98688387095, 0] I get $\frac{117300079}{39271724}$ However, when I run N[117300079/39271724, 50] ...
1
vote
1answer
1k views

Converting Matlab code to Mathematica [closed]

I have following Matlab code: ...
2
votes
1answer
105 views

ToExpression and RowBox — orderings

With: ToExpression[RowBox[{"c", ToBoxes[Plot[Sin[x], {x, -2, 2}]], "a"}]] I get the three elements of the array, but with "a" and then "c" at the beginning. I ...
2
votes
1answer
690 views

Mathematica to Matlab

my question is a duplicate of : Is it possible to export the equations from Mathematica to MATLAB? I did some symbolic calculations in Mathematica and want to transfer the result to Matlab. The ...
3
votes
1answer
627 views

How to Convert Mathematica Notebooks to PDF's?

My book is done. I'm left with twenty seven (27) Mathematica Notebooks (.nb's) How do I convert these notebooks to the pdf format? How do I combine all twenty seven (27) pdfs into a single pdf? Thanks ...
4
votes
1answer
87 views

Subtracting Missing[] the old way

In previous versions of Mathematica Missing[]- Missing[] would output Missing[]- Missing[]. In the current version is outputs 0. Is there a way to get Mathematica to revert back to the old output? ...
6
votes
1answer
323 views

How to transform general Ellipsoid into rotated axis-oriented one?

Recently, I discovered a long-standing bug in the rendering of Disk and Circle primitives after applying ...
0
votes
1answer
62 views

ToExpression Error when parsing MathML in XML

My code for parsing MathML to be readable in Mathematica: ToExpression @ ImportString @ ExportString[#, "XML"]& /@ Cases[ xml, XMLElement["math", _, _],∞ ] ...
2
votes
1answer
727 views

CMD method to convert .nb file into .m file

.nb file consists of the boxes, and the .m file is a pure text file, what can help to share on GitHub. Of course, we can open a <...