You need to get the contents of the png to get output. Maybe the type
command will do that. E.g. Add as the last line:

type testplot.png


On Sun, Aug 13, 2017 at 1:34 AM Uwe Brauer <o...@mat.ucm.es> wrote:

>
> 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
>
>
> --
John

-----------------------------------
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu

Reply via email to