Solve for, and then substitute.
Mostrar comentarios más antiguos
I posted before, but I am not getting the answers I am looking for. This is a simplified version of what I want to do.
say, f(t)=y*t, and we are given an initial condition f(1)=10. We can use this information to solve for y..
Now that we know, y=10, solve for f(2)=?, obviously f(2) will equal 20.
How can I write this code in MATLAB?
2 comentarios
Kyle Langford
el 19 de Feb. de 2022
Editada: Walter Roberson
el 19 de Feb. de 2022
Kyle Langford
el 19 de Feb. de 2022
Respuesta aceptada
Más respuestas (1)
you can use anonymous function:
y=10;
f=@(t) y*t;
f(1)
f(2)
1 comentario
Kyle Langford
el 19 de Feb. de 2022
Categorías
Más información sobre Code Performance 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!
