How can I use arrayfun and integral as anonymous function?
Mostrar comentarios más antiguos
t=0:0.1:1;
v=0.2;
fun1=@(s,t) s .* exp(-s).* ( (t-s) .^(v-1) ) ;
%gex= @(t) arrayfun(@(t) integral (@(s) fun1(s,t) ,0,t), t);
if t==0
gex= @(t) 0;
else
gex= @(t) arrayfun(@(t) integral (@(s) fun1(s,t) ,0,t), t);
end
How do I exclude input
t=0
and make it into a new value inside the matrix namely, gex, i.e, gives
gex(t)
as one matrix and set the value of
gex(t(1))=0
in same time?
2 comentarios
David Hill
el 10 de Jun. de 2021
I have no idea what you are trying to do. What is the array t?
Respuesta aceptada
Más respuestas (1)
Kapil Gupta
el 10 de Jun. de 2021
0 votos
I assume you want to know how you can use integral function as anonymous function. The following MATLAB Answers link has a similar query, you can check this out:
1 comentario
work wolf
el 10 de Jun. de 2021
Categorías
Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!