Matrix Dimensions must agree using integral
Mostrar comentarios más antiguos
Hello all,
I am trying to integrate over a function.
% calculation of f(b)
b = exp((-q*Vj)/(2*kB*Temp))*cosh((Et-Ei)/((kB*Temp)+0.5*(log(tau_p0/tau_n0))));
% integrate over x while varying b
fcn_b = zeros(1,length(b));
fcn = @(x)1./((x.^2)+(2.*b.*x)+1);
fcn_b = integral(fcn,0,Inf);
end
But I receive an error after the fcn = @x line saying matrix dimensions must agree.
The size of b => 1 x 141. Any help would be appreciated.
2 comentarios
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Numerical Integration and Differentiation en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!