emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: stardiviner <numbchild@gmail.com>
To: org-mode <emacs-orgmode@gnu.org>
Subject: Re: Need somebody knows Octave help on ob-octave.el error
Date: Fri, 23 Mar 2018 16:16:19 +0800	[thread overview]
Message-ID: <106ff020-037c-48ce-546e-78cd482ef8bc@gmail.com> (raw)
In-Reply-To: <87bmff4ppp.fsf@ucl.ac.uk>

[-- Attachment #1: Type: text/plain, Size: 1260 bytes --]

After check out source code of `ob-octave.el`, I found only one places 
used `ans.m`:

```

(defvar org-babel-octave-wrapper-method
   "%s
if ischar(ans), fid = fopen('%s', 'w'); fprintf(fid, '%%s\\n', ans); 
fclose(fid);
else, dlmwrite('%s', ans, '\\t')
end")

```

Might Octave package versions compatition issue or something elseraised 
this error. Based on the error hints, should  be the calling to `ans` is 
wrong. After tesing upper code in Octave REPL, it works fine. that 
weird. The upper variable is just a wrapper around src block `body`for 
saving`ans` to file.

Anyway, hope somebody who knows elisp and Octave can check this out.


On 03/23/2018 08:09 AM, Eric S Fraga wrote:
> On Friday, 23 Mar 2018 at 07:55, stardiviner wrote:
>> I got the following error after executing src block:
>>
>> ```
>>
>> error: invalid call to script /usr/share/octave/4.2.2/m/help/ans.m
> I see the same.  Not sure why this is happening but you can fix it but
> adding any line after the saveas statement that would generate a value,
> e.g. just a "1" will do:
>
> #+begin_src org
>    ,#+begin_src octave :results file :dir "data/images" :file "figure1.png"
>    clf ();
>    surf (peaks);
>    saveas (1, "figure1.png");
>    1
>    ,#+end_src
> #+end_src
>


[-- Attachment #2: Type: text/html, Size: 7506 bytes --]

      reply	other threads:[~2018-03-23  8:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-22 23:55 ob-octave.el raise error after execute src block stardiviner
2018-03-23  0:09 ` Eric S Fraga
2018-03-23  8:16   ` stardiviner [this message]

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=106ff020-037c-48ce-546e-78cd482ef8bc@gmail.com \
    --to=numbchild@gmail.com \
    --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).