error using ezmeshc when using 'defaultte​xtinterpre​ter','late​x'

2 views (last 30 days)
any one knows why Matlab generates an error when using 'defaulttextinterpreter','latex' with "ezmesh" and friends? This below work OK
reset(0);
figure(1)
fh = @(u1,u2) u1-u2 ;
ezmeshc(fh,[-3,3,-3,3],30)
But now if I do
set(0,'defaulttextinterpreter','latex')
ezmeshc(fh,[-3,3,-3,3],30)
I get an error
Warning: Error updating Text.
String must have valid interpreter syntax:
{u_{1}}-{u_{2}}
Warning: Error updating Text.
String must have valid interpreter syntax:
{u_{1}}
Warning: Error updating Text.
String must have valid interpreter syntax:
{u_{2}}
This is on Matlab 2015a, windows 32 bit.
This error shows up also on same call to "ezmesh" and "ezsurfc". These functions seems to be confused with the setting of the title when using Latex interpreter. I have many plots, and I set set(0,'defaulttextinterpreter','latex') at the start of the code. I noticed only these ezmesh are only ones who do not like this settings.

Answers (1)

Mike Garrity
Mike Garrity on 1 Feb 2016
The "EZ" functions make up nice titles and labels for you from the functions you give them. But they do that by generating TeX formatted strings. So when you set the default interpreter to LaTeX, it gets cranky about these strings that have the wrong formatting.
I'm afraid that I can't think of a great workaround. The input argument parsing of the "EZ" functions isn't very flexible, so it's hard to change their behavior.

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!