Hi
I would like to execute some matlab code in org file (using GNU emacs 26
and the git version of org mode) and save the result of the plot command
in a png file, so I tried
#+begin_src matlab :session :exports both :file testplot.png
t=[0:0.1:1];
y=sin(t);
plot(t,y)
print -dpng testplot.png
#+end_src
And also
#+begin_src matlab :results output latex :exports results :file testplot.png
t=[0:0.1:1];
y=sin(t);
plot(t,y)
print -dpng testplot.png
#+end_src
But the resulting png files are corrupt. I presume also the matlab
commands are included in the png file which is not correct. But I don't
know who to achieve that just the last command is saved in a png file.
I googled without success. Does somebody know the correct syntax?
Thanks
Uwe Brauer