Need helping creating and solving for this equation: f(t)=4- t^2 e^(-3t)
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Write a MATLAB program that will evaluate and plot the function.
for the time range 0 ≤ t ≤ 3 seconds using 100 t values. Use iteration (for loop) and scalar operations to solve this problem.
- allocate space for the time and function vectors
- You can use zeroes function to initialize f and t vectors
- Iterate over indices of t and f vectors to create each value of t, store it in t, calculate f, and store it f.
- Use 2D plot to display the result of t versus f(t)
- Upload code and the display as the submission for the assignment.
3 comentarios
James Tursa
el 1 de Oct. de 2020
What have you done so far? What specific problems are you having with your code?
Respuestas (1)
James Tursa
el 2 de Oct. de 2020
Here is a basic outline to get you started:
n = 100; % Number of elements
t = zeros( you fill this in ); % create an t vector based on n, see doc zeros for the syntax
f = zeros( you fill this in ); % create an f vector the same size as t
for k = something:something <-- you fill in the something based on the size of t
t(k) = something; <-- you fill in the something based on your delta-t spacing
f(k) = something; <-- you fill in the something based on the value of t(k)
end
plot( something ) <-- you fill in the something, see doc plot for the syntax
0 comentarios
Ver también
Categorías
Más información sobre 2-D and 3-D Plots 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!