emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [bug?] [babel] cannot generate table format output for octave results
@ 2011-01-14  9:22 Eric S Fraga
  2011-04-14  3:44 ` Ethan Ligon
  0 siblings, 1 reply; 2+ messages in thread
From: Eric S Fraga @ 2011-01-14  9:22 UTC (permalink / raw)
  To: Emacs Org mode mailing list

Hello,

I want an octave babel code block to generate an org table as the
/result/ so that it can be used by another code block elsewhere in my
document.  Typically, because of how I generate my data, I would like
babel to create the table from the /output/ of the octave code, not the
value.  However, specifying =:results output table= doesn't seem to work
(for me, in any case).

The following is an example with two octave babel code blocks.  The
first asks for the /value/ of the block to be extracted and converted to
an org table.  This works fine.  The second block asks for the /output/
to be converted.  This doesn't work in that the output is not converted
to org table syntax *and* the output is encapsulated in an /example/
block.

--8<---------------cut here---------------start------------->8---

  #+srcname: valueresult
  #+begin_src octave :results value table
values = [];
for i=1:15
  values(end+1,:) = [i, i^3];
endfor
ans = values
  #+end_src

  #+results: valueresult
  |  1 |    1 |
  |  2 |    8 |
  |  3 |   27 |
  |  4 |   64 |
  |  5 |  125 |
  |  6 |  216 |
  |  7 |  343 |
  |  8 |  512 |
  |  9 |  729 |
  | 10 | 1000 |
  | 11 | 1331 |
  | 12 | 1728 |
  | 13 | 2197 |
  | 14 | 2744 |
  | 15 | 3375 |

  #+srcname: outputresult
  #+begin_src octave :results output table
values = [];
for i=1:15
  values(end+1,:) = [i, i^3];
endfor
disp(values)
  #+end_src

  #+results: outputresult
  #+begin_example
	1      1
	2      8
	3     27
	4     64
	5    125
	6    216
	7    343
	8    512
	9    729
       10   1000
       11   1331
       12   1728
       13   2197
       14   2744
       15   3375
#+end_example
--8<---------------cut here---------------end--------------->8---

I should add that I am having a great deal of fun with org and babel at
the moment!  I am finishing off a paper and the presentation of the
results of my research requires me to run some code (octave) to generate
a rather large set of results that go into a number of data files.  I
then process these files with a shell script block using awk to extract
the necessary information for presentation. The output of this is passed
to another octave block which does some data analysis.  The analysis
results are then passed to a gnuplot block.  Very simple chain of blocks
that I used to do all separately but that I can now have in a single
document.  In fact, I have two chains from the same initial code to
present two different aspects of the results.

Babel is fantastic basically.  Well, so is org, of course.  Thanks
(again and again) to all org and babel implementers!

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 23.2.1
: using Org-mode version 7.4 (release_7.4.174.g163cd)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [bug?] [babel] cannot generate table format output for octave results
  2011-01-14  9:22 [bug?] [babel] cannot generate table format output for octave results Eric S Fraga
@ 2011-04-14  3:44 ` Ethan Ligon
  0 siblings, 0 replies; 2+ messages in thread
From: Ethan Ligon @ 2011-04-14  3:44 UTC (permalink / raw)
  To: emacs-orgmode

Hi-

Eric S Fraga <e.fraga <at> ucl.ac.uk> writes:
> 
> Hello,
> 
> I want an octave babel code block to generate an org table as the
> /result/ so that it can be used by another code block elsewhere in my
> document.  Typically, because of how I generate my data, I would like
> babel to create the table from the /output/ of the octave code, not the
> value.  However, specifying =:results output table= doesn't seem to work
> (for me, in any case).

<snip>

I can report a very similar apparent bug, but using python.

-- 
Ethan Ligon, Associate Professor
Agricultural & Resource Economics
University of California, Berkeley

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-04-14  3:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-14  9:22 [bug?] [babel] cannot generate table format output for octave results Eric S Fraga
2011-04-14  3:44 ` Ethan Ligon

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).