Thanks,

Your first option works like a charm

cheers,
M
On Apr 28, 2014, at 9:07 AM, Alan Schmitt <alan.schmitt@polytechnique.org> wrote:

On 2014-04-28 14:41, Marvin Doyley <marvinpas@gmail.com> 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