Info
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
Issues implementing quad function to a definite integral using element by element calculations
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Adriel Martinez-Alvarez
el 7 de Abr. de 2017
Cerrada: MATLAB Answer Bot
el 20 de Ag. de 2021
Hello, I am having issues with element by element math when trying to implement the quad function to calculate a definite integral. I keep receiving an error from the compiler, however, my other functions are working. Could someone please guide me in fixing my last function (y5)?
y2 = quad('(.5*x.^3)./(1+2*sqrt(x))', 2, 10)
y3 = quad('.5 + ((cos(1.2*x))./((x+2).^2))', 0, 9)
y4 = quad('(exp(x))./(x.^3)', 1, 8)
y5 = quad('((cos(x)). * (exp^(sqrt(x)))', 0, pi*4)
0 comentarios
Respuestas (2)
Star Strider
el 7 de Abr. de 2017
Instead of the single-quote syntax that is probably not permitted, use Anonymous Function syntax.
Example —
y2 = quad(@(x) (.5*x.^3)./(1+2*sqrt(x)), 2, 10)
y2 =
190.2484
0 comentarios
Torsten
el 10 de Abr. de 2017
y5=quad('cos(x).*exp.^sqrt(x)',0,pi*4)
Best wishes
Torsten.
0 comentarios
La pregunta está cerrada.
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!