Using MATLAB in Julia

i have installed MATLAB and the package to my Julia as given in “https://github.com/JuliaInterop/MATLAB.jl

Now I am trying to run the example codes given here for a quick start.

for example this code:
x = range(-10.0, stop=10.0, length=500)
mat"plot($x, sin($x))" # evaluate a MATLAB function

is working perfectly.

But when I am running
y = range(2.0, stop=3.0, length=500)
mat"""
$u = $x + $y
$v = $x - $y
“”"
@show u v

I am getting, “syntax: incomplete: invalid string syntax”

I am observing the problem is arising only when I am using the mat"" custom string literal. What can be the issue? anyone has experience with it?

Thanks!

You are using the wrong double quotes " at the end of the string literal

Try

mat"""
$u = $x + $y
$v = $x - $y
"""
2 Likes