help-octave
[Top][All Lists]
Advanced

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

Re: Integration with quad


From: Przemek Klosowski
Subject: Re: Integration with quad
Date: Wed, 09 Dec 2009 14:44:51 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.4pre) Gecko/20090922 Fedora/3.0-3.9.b4.fc12 Thunderbird/3.0b4

On 12/09/2009 02:07 PM, Thomas Göbel wrote:
function y = rect(t)
if t<=0.5
     rect=1
else
     rect=0
end
endfunction

For integration i use

foo = quad('rect',-1,2)

I think you want this:

function y=rect(t); if t<=0.5 y=1; else y=0; end; endfunction

Your function does not assign to the result variable 'y' so it fails
on what I believe is the first call to it from 'quad()'.


reply via email to

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