Skip to content

About an integral univariate problem

1 message · R. Michael Weylandt

#
Your original code was not directly vectorizible (and I should have
noted that): this should work:

fnc <- function(x, y) {
    z <- outer(y, x, FUN = "^")
    exp(-x) * colSums(z)
}
y <- c(2,3,5)
integrate(fnc, 0, 3, y)

This should work and sorry for the initial confusion.

Michael

On Tue, Oct 18, 2011 at 11:05 AM, Freddy Hernandez Barajas
<fhernanb at gmail.com> wrote: