A "dummy" variable is a variable that is integrated out of the equation. All definite integrals use "dummy" variables in their formulation, so I don't understand the question. The only thing I can think that you might mean is that you need to express the integrals in a parameterized way, i.e. in a form where the result is not a constant, rather a function of the parameters that need to be specified. That is done using anonymous functions. For example, suppose
and I need to integrate f from 0 to 1. I can do this by creating an anonymous function that binds the value of c when it is needed.
Now if you try to run that as-is, without first defining c, you will get the error
Undefined function or variable 'c'.
Or if c was already defined, it will use that value of c and no other. What we need to do is make this a function, and thereby defer its evaluation until we give it the c we want it to use.
qs = @(c)integral(@(x)f(x,c),0,1)
Now we can evaluate qs with different values of c:
But we can't do this yet
Error using +
Matrix dimensions must agree.
Error in @(x,c)x.^2+c
To make our function of c more useful in MATLAB, we need to enable it to process arrays and operate element-wise. This is done with ARRAYFUN:
>> q = @(c)arrayfun(qs,c)
1.333333333333333 2.333333333333334 3.333333333333334
So, by using function handles and deferring evaluation until the parameter values are available, we can represent the solution to a parameterized problem.