From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Davison Subject: Re: org-babel matlab example Date: Sat, 11 Sep 2010 11:29:18 -0400 Message-ID: <87iq2c2t9t.fsf@stats.ox.ac.uk> References: <20100911.101806.1287597470496846955.etimecowboy@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=37327 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OuS17-0000Og-U1 for emacs-orgmode@gnu.org; Sat, 11 Sep 2010 11:29:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OuS16-0005Sl-Nj for emacs-orgmode@gnu.org; Sat, 11 Sep 2010 11:29:25 -0400 Received: from markov.stats.ox.ac.uk ([163.1.210.1]:54533) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OuS16-0005SI-Ff for emacs-orgmode@gnu.org; Sat, 11 Sep 2010 11:29:24 -0400 In-Reply-To: <20100911.101806.1287597470496846955.etimecowboy@gmail.com> (etimecowboy@googlemail.com's message of "Sat, 11 Sep 2010 10:18:06 +0100 (BST)") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: etimecowboy Cc: emacs-orgmode@gnu.org etimecowboy writes: > Hi everybody, > > I am learning to use org-babel to evaluate in-line Matlab code block, > but I cannot make it works when I press the "C-c C-c", nor "C-c C-v > e". What happens when you try C-c C-c or C-c C-v e ? There is an issue with matlab and octave: they return the value of the last /unassigned/ computation, so simply ending the code block with a variable name "x" is not enough. Could you try one of the following schemes please, and let us know if that solves it: #+begin_src matlab :exports results n = [1:10]; x = 5*n+4; ans = x #+end_src #+begin_src matlab :exports results n = [1:10]; x = 5*n+4; x + 0 #+end_src > The export of code works, but the results was not there. My in-line code is like this: There was a little typo in your original block: the keyword is ":exports" with an s. Dan > > #+begin_src matlab :export results > n = [1:10]; > x = 5*n+4; > x > #+end_src > > Is there someone can provide me a working example? Thanks a lot. > > > ----------------------------- > > etimecowboy@gmail.com > > _.,----,._ > .:' `:. > .' `. > .' `. > : : > ` .'`':'`'`/ ' > `. \ | / ,' > \ \ | / / > `\_..,,.._/' > {`'-,_`'-} > {`'-,_`'-} > {`'-,_`'-} > `YXXXXY' > ~^^~ > > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode