limits of integration must be double or single scalars. in matlab

The limits of integration in Matlab must be double or single scalars. This means that you can't use vectors or matrices as inputs for the limits of integration.

Here's an example of how to use double or single scalars as limits of integration:

main.m
syms x;
int(x^2, 0, 1) % limits of integration as double scalars

a = 0;
b = 1;
int(x^2, a, b) % limits of integration as single scalars
137 chars
7 lines

In the code above, we define a symbolic variable x, and then we calculate the definite integral of x^2 from 0 to 1. We then repeat this integral, but this time we use variables a and b as the limits of integration instead of directly inputting the double scalars.

gistlibby LogSnag