After you save the file, start Python and call the script.
import matlab.engine
eng = matlab.engine.start_matlab()
eng.triarea(nargout=0)
a =
7.5000
Specify nargout=0. Although the script prints output, it returns no output arguments to Python.
Convert the script to a function and call the function from the engine. Open the MATLAB editor to edit the file.
eng.edit('triarea',nargout=0)
I want for example return the variable a in my python window! How can i do that?