From: Eric S Fraga <e.fraga@ucl.ac.uk>
To: emacs-orgmode@gnu.org
Subject: Re: workflow, matlab+latex in org file
Date: Mon, 11 Jul 2016 17:42:34 +0100 [thread overview]
Message-ID: <87inwcm8hx.fsf@ucl.ac.uk> (raw)
In-Reply-To: <c0b96d809e4b41529f81beaa685a9fd0@HE1PR01MB1898.eurprd01.prod.exchangelabs.com> (Uwe Brauer's message of "Mon, 11 Jul 2016 12:32:47 +0000")
On Monday, 11 Jul 2016 at 12:32, Uwe Brauer wrote:
> Hello
>
> I want in a org file, to include matlab code and run it (that I know how
> to do)
>
> Then I want certain results, which are symbolic variables, expressed in
> latex, we I achieve using matlab's latex command.
>
> Like
>
> #+begin_src matlab :results output
> clear all
> syms e p R g w K K2
> phi=[(e + (e+p)*R^2)^((g-1)/2);((e+p)*R*sqrt(1+R^2))/(e+(e+p)*R^2)]
>
> jac=jacobian(phi,[e,p])
> ltxjac=latex(jac)
> #+end_src
A bit of a kludge but, if you don't want to modify the ob-matlab code,
you can explicitly generate LaTeX into a file and use it directly:
--8<---------------cut here---------------start------------->8---
#+begin_src octave :exports none :results output
clear all
pkg load symbolic
syms e p R g w K K2;
phi=[(e + (e+p)*R^2)^((g-1)/2);((e+p)*R*sqrt(1+R^2))/(e+(e+p)*R^2)];
jac=jacobian(phi,[e,p]);
ltxjac = latex(jac);
fid = fopen("jacobian.tex","w");
fprintf(fid, "%s\n", ltxjac);
fclose(fid);
ltxjac
#+end_src
\begin{equation}
\input{jacobian}
\end{equation}
--8<---------------cut here---------------end--------------->8---
I don't have MATLAB so have tested with octave instead...
--
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.94.1, Org release_8.3.4-869-gf2c421
next parent reply other threads:[~2016-07-11 16:43 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <c0b96d809e4b41529f81beaa685a9fd0@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2016-07-11 16:42 ` Eric S Fraga [this message]
2016-07-12 12:44 ` workflow, matlab+latex in org file Uwe Brauer
[not found] <m2eg709w4s.fsf@gmail.com>
2016-07-11 13:55 ` Uwe Brauer
2016-07-11 12:32 Uwe Brauer
2016-07-11 14:05 ` John Kitchin
2016-07-11 14:11 ` Uwe Brauer
2016-07-11 15:55 ` John Kitchin
2016-07-11 16:12 ` Uwe Brauer
2017-03-10 16:08 ` Uwe Brauer
2017-03-10 17:51 ` Scott Randby
2017-03-10 21:15 ` Uwe Brauer
2017-03-10 21:56 ` John Kitchin
2017-03-10 22:50 ` Uwe Brauer
2017-03-11 23:50 ` Scott Randby
[not found] ` <5e1e71e3698e415ca51a0b9e3cab5dac@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2017-03-10 18:03 ` Eric S Fraga
2017-03-10 21:18 ` Uwe Brauer
2017-03-11 8:04 ` Uwe Brauer
2017-03-11 13:23 ` John Kitchin
2017-03-11 14:16 ` Uwe Brauer
2017-03-11 14:22 ` John Kitchin
2017-03-11 14:54 ` Uwe Brauer
2017-03-11 16:50 ` Uwe Brauer
2017-03-11 16:53 ` John Kitchin
2017-10-20 11:03 ` Uwe Brauer
2017-10-20 11:54 ` Uwe Brauer
[not found] ` <cf7ef1dfa1cf455bbaf63ab5fbdf18e5@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2017-03-11 10:37 ` Eric S Fraga
2017-03-11 14:12 ` Uwe Brauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87inwcm8hx.fsf@ucl.ac.uk \
--to=e.fraga@ucl.ac.uk \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).