Solve integral with a power
Mostrar comentarios más antiguos
Hi,
I try to solve the integral of an exponential function. Here is my code :
a1 = -0.0024 ; a0 = 0.0581 ;
fun1 = @(s,a,b) exp(a*s + (1/2)*b*(s^2)) ; fun2 = @(s) fun1(s,a0,a1) ; z = integral(fun2,10,45) ;
Matlab says : _____ Error using ^ Inputs must be a scalar and a square matrix. To compute elementwise POWER, use POWER (.^) instead. _____
If I use .^ there is no more problem, but I don't understand why s is not considered as a scalar. Does someone have some clue ?
Respuesta aceptada
Más respuestas (1)
Sylvain
el 6 de Mzo. de 2014
0 votos
Categorías
Más información sobre MATLAB 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!