MATLAB: I’m trying to find the integral of dv and all variables have been defined. I get the error message ‘Dot indexing is not supported for variables of this type.’ or if I remove the dot I get ‘Not enough input arguments.’ Please show me the error. than

MATLABnumerical integration

theta1 = pi/4;
h0 = 30*10^-2;
a = 1*10^-2;
g = 9.81;
t_empty = (2*((tan((pi/2)-theta1))^2)*(h0^(5/2)))/(5*(a^2)*sqrt(2*g));
t = (0:0.01:t_empty/2);
ht = ((h0^(5/2))-(5*a^2*(sqrt(2*g).*t)/(2*(tan((pi/2)-theta1)^2))));
r = ((tan((pi/2)-theta1)).*ht);
dv = 1/3*pi*(r.^2).*((((-a)^2)*sqrt(2*g))/(tan((pi/2)-theta1)^2).*(ht.^(-3/2)));
integral(dv)

Best Answer

The erroir is that ‘dv’ must be defined as a function of one variable, and it is not defined as a function at all.
What variable do you want to integrate it with respect to?