Multiple outputs of a single function in a single array
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Jamshid Ruziev
el 23 de Abr. de 2022
Comentada: Voss
el 23 de Abr. de 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 comentarios
Respuesta aceptada
Voss
el 23 de Abr. de 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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Loops and Conditional Statements en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!