I have the following code, trying to integrate a function f with respect to the variable t, but needing to accept the parameter cfb (which has to be calculated beforehand). How do I pass in cfb via the int() function?
f = @(t) (cfb.*t)
…
cfb = %Something
d = integral(f, 0, upperLimit)
How do I change this code so that f can take both t (from integral) and cfb as parameters? I tried just changing it so f=@(t,cfb) and integral(f(cfb)..., but that just resulted in an error that f wasn’t taking in enough parameters.
Your idea of using an anonymous function is good. Just define
cfbbefore that.