Multiple outputs of a single function in a single array
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Jamshid Ruziev
am 23 Apr. 2022
Kommentiert: Voss
am 23 Apr. 2022
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 Kommentare
Akzeptierte Antwort
Voss
am 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);
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!