Multiple outputs of a single function in a single array
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposta accettata
Voss
il 23 Apr 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);
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Loops and Conditional Statements in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!