How to create a Matlab symbol composition ∆t?

Viewed 337

I'd like to create a single symbol which is contains a delta "∆" and a t. For visualisation purposes i use Matlab Live Script.

Combining several latin letters is easy done by:

sym('dt')

dt2

But these either result in an exception or don't do a conversion:

sym('Delta t')
sym('Deltat')

The workaround to multiply two symbols does not work in all cases:

sym('Delta')*sym('t')

deltat

(sym('Delta')*sym('t'))^2

delta2t2

However, if i square the symbol, i'd like to have this behavior:

sym('dt')^2

dt2

But it should contain the delta symbol:

deltat2

2 Answers

Is this what you want?

title('\Deltat')

enter image description here

If you want, you can also do

title('\Deltat^{2}')

enter image description here

The answer is no, you cant use non-ASCII for variables in MATLAB. This means no \Delta, no \epsilon, or any other non-standard chars.

You can generate the LaTeX representation of the results, and then print them either in text in MATLAB or in your favourite LaTeX editor with the function latex

Related