help-octave
[Top][All Lists]
Advanced

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

Integration with quad


From: Thomas Göbel
Subject: Integration with quad
Date: Wed, 9 Dec 2009 20:07:21 +0100
User-agent: Mutt/1.5.20 (2009-06-14)

Hi all,

i want to integrate the following function:

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

For integration i use 

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

but get the following error message.

warning: rect: some elements in list of return values are undefined
error: invalid conversion from real matrix to real scalar
error: quad: evaluation of user-supplied function failed

I dont understand why octave tells me there is an invalid conversion.
Hope somebody can help me.

Thanks,
Tom
-- 
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments

Attachment: pgpwIVTcmA3lG.pgp
Description: PGP signature


reply via email to

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