How do you integrate a constant?

24 vues (au cours des 30 derniers jours)
Manil Athapattu
Manil Athapattu le 29 Juin 2017
Modifié(e) : Torsten le 21 Nov 2022
theta and miu are constants
theta = 0.01305
miu = 0.0546
const = @(x) tan(theta + miu)
r = integral(constant,0,1)
  1 commentaire
Jan
Jan le 29 Juin 2017
The integral of a constant function is the size of the rectangle between the curve and the X axis: const * (1 - 0).

Connectez-vous pour commenter.

Réponse acceptée

Joshua
Joshua le 29 Juin 2017
Modifié(e) : Torsten le 21 Nov 2022
theta = 0.01305
theta = 0.0131
miu = 0.0546
miu = 0.0546
const = @(x) tan(theta + miu)+0*x
const = function_handle with value:
@(x)tan(theta+miu)+0*x
r = integral(const,0,1)
r = 0.0678
  2 commentaires
Yianni Koumarnetos
Yianni Koumarnetos le 21 Nov 2022
I am doing this and it is telling me that the integral is an error.
Torsten
Torsten le 21 Nov 2022
Modifié(e) : Torsten le 21 Nov 2022
Don't forget the +0*x when integrating your constant function.
Or use
theta = 0.01305
theta = 0.0131
miu = 0.0546
miu = 0.0546
const = @(x) tan(theta + miu)
const = function_handle with value:
@(x)tan(theta+miu)
r = integral(const,0,1,'ArrayValued',true)
r = 0.0678

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Numerical Integration and Differentiation dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by