
From:  John Kitchin 
Subject:  Re: [O] workflow, matlab+latex in org file 
Date:  Sat, 11 Mar 2017 14:22:46 +0000 
> You might dig around in oboctave to see how it works. It should be able
> to Matlab (and on Linux/Mac I believe it might). On Windows, it has been
> broken for a long time due to the lack of a proper shell (maybe that can
> be adapted in win10 though).
> I vaguely recall making that matlab function to try it out on Windows
> some years ago.
> There is a Jupyter Matlab kernel now.
> https://github.com/Calysto/matlab_kernel
Thanks for pinting it out to me. Couldn't install it so far
ImportError: No module named pathlib
when trying directly to use >python m matlab_kernel install
Or ould not find a version that satisfies the requirement backports.tempfile (from matlabkernel) (from versions: 1.0rc1, 1.0rc1)
Cleaning up...
No distributions matching the version for backports.tempfile (from matlabkernel)
Storing debug log for failure in /home/oub/.pip/pip.log
Have to write the author.
The output using your code and Eric's suggestion is ok but I am curious
to see what the kernel is supposed to do better.
Uwe
> I was able to use this (and installing the kernel, and making sure a
> matlab is on the path):
> #+BEGIN_SRC emacslisp
> (addtolist 'orgsrclangmodes '("matlab" . matlab))
> ;; set default headers for convenience
> (setq orgbabeldefaultheaderargs:matlab
> '((:results . "output replace")
> (:session . "matlab")
> (:kernel . "matlab")
> (:exports . "code")
> (:cache . "no")
> (:noweb . "no")
> (:hlines . "no")
> (:tangle . "no")))
> (defalias 'orgbabelexecute:matlab 'orgbabelexecute:ipython)
> (defalias 'orgbabelprepsession:matlab 'orgbabelprepsession:ipython)
> (defalias 'orgbabelmatlabinitiatesession 'orgbabelipythoninitiatesession)
> #+END_SRC
> #+RESULTS:
> : orgbabelmatlabinitiatesession
> To enable this:
> #+BEGIN_SRC matlab :results output org drawer
> x = [1, 2, 3, 4, 5];
> fprintf('%d', x)
> #+END_SRC
> #+RESULTS:
> :RESULTS:
>  1  2  3  4  5 
> :END:
> It is not much better output wise without the fprintf, but that seems to
> be a feature of Matlab's output. I think Eric is probably right, you
> will have use fprintf to get what you want.
> I am not a big matlab user these days, so I do not have a sense for how
> usable the kernel is. It does run in a session, which is a big
> improvement over the other one I wrote.
> Uwe Brauer writes:
[Prev in Thread]  Current Thread  [Next in Thread] 