[Top][All Lists]

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

integrating functions of more than one variable

From: marco
Subject: integrating functions of more than one variable
Date: Sun, 30 Oct 2005 23:05:36 -0500
User-agent: Mutt/1.4.2i

Hi all,

I've succesfully integrated a function k(x,z) by using
the "global" trick e.g.:

global z = 1.5;
global a = -pi/2;

function r = k(x)
  global z;
  r = 2*sin(x).*sqrt((z + sin(x)));

function [r, stat, iter, err] = L(b)
  global a;
  [r, stat, iter, err] = quad("k", a, b);

I later make a plot of "L" as a function of the upper limit
"b" (with z constant).

However, I would like now to make a 3d plot of L as a function
of both "b" and "z" (say, by making two nested loops, one
over "b" and the other one over "z" e.g. "for z_i = z_vec").
Unfortunately, I'm stuck. I've tried the "global" trick by
running "clear z" and re-declaring "global z = z_i" in the
loop but you can only declare a global once. Any ideas on how
I could go about this? I'm running octave 2.1.71.

Thank you!

Gunnm: Broken Angel                        

Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

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