Numerical integration in matlab2018
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Dear Friends,
This looks simple but am not able to get it. Could you help me out.
I have the following variable in a equation that needs to be integrated
its like
L = linspace(0.3,4.5,2000);
T = 100;
fun = @(T) ((0.4175./L.^3) - (0.6643./L.^2) + (0.9036./L) + 3.5332 - 0.0744.*L).*10^-5.*(1 + 0.00276.*T);
q = integral(fun,20,T)
However, when i rum this, iam getting an error. Could you help me out on solving this.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/215271/image.png)
3 commentaires
Adam Danz
le 22 Avr 2019
Check out these examples provided by matlab (link below). When you evalue the functions in those example, you'll see that they return a single value.
When I evaluate your function, a vector is returned:
>> fun(20)
ans =
Columns 1 through 6
0.00015411 0.00015159 0.00014914 0.00014676 0.00014444 0.0001422
Columns 7 through 12
0.00014002 0.0001379 0.00013584 0.00013383 0.00013189 0.00012999
Columns 13 through 18
0 ...... (2000 elements long)
Did you expect that your function returns a single value or do you expect that it returns a vector?
Réponses (0)
Voir également
Catégories
En savoir plus sur Numerical Integration and Differentiation dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!