From help-octave-request at bevo dot che dot wisc dot edu Tue Dec 19 16:31:38 2000 Subject: anonymous functions? From: Han-Wen Nienhuys To: help-octave at bevo dot che dot wisc dot edu Date: Tue, 19 Dec 2000 23:33:12 +0100 Hi there! Please bear with me, I'm a newbie user. I want to build a simple meshless PDE solver in octave, but right at the start I get stuck. I'm trying to write a function to compute a gram-matrix, but I can't figure out how to pass an anonymous function to the quad procedure. What I am hoping|trying to do: function G = grammatrix (funcs) l = length (funcs) G = zeros (l,l) i = 0 j = 0 for f = funcs for g = funcs function p = prod(t) p = f(t) * g(t) endfunction G(i,j) = quad (prod,0, 1, [0, 0.01], []) j++ endfor i++ endfor endfunction -- Han-Wen Nienhuys | hanwen at cs dot uu dot nl| | http://www.cs.uu.nl/~hanwen/ ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------