# Running Matlab script from Freefem

**URL:** <https://community.freefem.org/t/running-matlab-script-from-freefem/2406>\
**Category:** General Discussion\
**Created:** [April 19, 2023, 12:36pm UTC](https://community.freefem.org/t/running-matlab-script-from-freefem/2406 "2023-04-19T12:36:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![luca.liverotti](https://avatars.discourse-cdn.com/v4/letter/l/977dab/32.png) [@luca.liverotti](https://community.freefem.org/u/luca.liverotti)\
**Post date:** [April 19, 2023, 12:36pm UTC](https://community.freefem.org/t/running-matlab-script-from-freefem/2406/1 "2023-04-19T12:36:47Z")

</div>

Hi, I should run a matlab script from Freefem.

I read that is possible run terminal command in Freefem by using exec(…) or system(…). Anyway, I have problems with the launch of a matlab script by terminal.

I tried

exec(s),

with s = “/Applications/MATLAB\_R2022a.app/bin/matlab -nodisplay -r /Desktop/Dottorato/Ricerca/img segmentation/stimatore roughening/untitled”

but I am getting this error:

_/Desktop/Dottorato/Ricerca/img_  
_|_

_Invalid use of operator._

Could you help me with this issue?

Thanks in advance,

Luca

---

<div class="post-metadata">

**Author:** ![marchywka](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@marchywka](https://community.freefem.org/u/marchywka)\
**Post date:** [April 19, 2023, 3:12pm UTC](https://community.freefem.org/t/running-matlab-script-from-freefem/2406/2 "2023-04-19T15:12:12Z")

</div>

What is the symbol between the matlab command and the parameter?  
This looks like a winsdows issue, or something with invoking matlab.  
What happens if you just type that string in at the command line?

I would suggest getting linux or cygwin 🙂
