Multiple outputs of a single function in a single array
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
P=exp(-0.152+0.859.*6.5-1.803.*log(10+25))
a=linspace(0,3)
for b=(log(a)-log(P))./0.57
fun=@(x) 1./sqrt(2.*pi).*exp(-1/2.*x.^2);
c=integral(fun,-Inf,b)
end
how can I get all outputs of 'c' in a single array? thanks in advance
0 commentaires
Réponse acceptée
Voss
le 23 Avr 2022
P=exp(-0.152+0.859.*6.5-1.803.*log(10+25));
a=linspace(0,3);
for ii = 1:numel(a)
b=(log(a(ii))-log(P))./0.57;
fun=@(x) 1./sqrt(2.*pi).*exp(-1/2.*x.^2);
c(ii)=integral(fun,-Inf,b);
end
disp(c);
2 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Loops and Conditional Statements 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!