# Calling Julia from MATLAB

**URL:** <https://discourse.julialang.org/t/calling-julia-from-matlab/51542>\
**Category:** General Usage\
**Tags:** embedding, matlab\
**Created:** [December 9, 2020, 6:26pm UTC](https://discourse.julialang.org/t/calling-julia-from-matlab/51542 "2020-12-09T18:26:32Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Iulian.Cioarca](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iulian.cioarca/32/30166_2.png) [@Iulian.Cioarca](https://discourse.julialang.org/u/Iulian.Cioarca)\
**Post date:** [December 9, 2020, 7:44pm UTC](https://discourse.julialang.org/t/calling-julia-from-matlab/51542/6 "2020-12-09T19:44:56Z")

</div>

Mex.jl also worked for me. I had a similar need:

> [@Passing strings from Matlab to Julia and back using Sockets](https://discourse.julialang.org/t/passing-strings-from-matlab-to-julia-and-back-using-sockets/46589):
>
> I needed a simple communication channel between Matlab and Julia. Maybe this will help someone, so here’s the code (spoiler alert, everything is an ascii character): ## Matlab to Julia TCPIP communication example # Julia - server side using Sockets server = listen(ip"127.0.0.1", 2001) sock = accept(server) x=0 @async while true global x = readline(sock) println(x) end # after receiving a message numeric = parse.(Float64, split(x)) # where x is "-1.2158 1.5908 0.52648", vector cov…

---

_[View the full topic](https://discourse.julialang.org/t/calling-julia-from-matlab/51542)._
