emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] org-babel pass data between blocks


From: Marvin Doyley
Subject: Re: [O] org-babel pass data between blocks
Date: Mon, 28 Apr 2014 10:52:39 -0400

Thanks,

Your first option works like a charm

cheers,
M
On Apr 28, 2014, at 9:07 AM, Alan Schmitt <address@hidden> wrote:

On 2014-04-28 14:41, Marvin Doyley <address@hidden> writes:

Dear All,

Is there way to pass data between blocks in org-babel. For example lets say have two blocks


#+begin_src python
from pylab import *
# Simple carrier
t=linspace(0,1,100);
fc=100;
Ac =1;
C=Ac*cos(2*pi*t);

#+end_src


What I would like to do is to pass both C and t to another python block, but it is not clear how to do this.

#+begin_src python 
from pylab import *

fm=1;
Am=1
m=Am*cos(2*pi*t); # message signal

z=m*C;   #double side-band modulated signal

#+end_src

I see three options (there are probably many others):
- use a session (see
http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-python.html
for instance);
- have C and t be the results of the first block, and chain the blocks;
- use noweb to include the second block is the first block.

Alan


reply via email to

[Prev in Thread] Current Thread [Next in Thread]