Storing Value From For Loop
Mostrar comentarios más antiguos
I'm having trouble trying to store my values into a variable. The question of this is:
A necklace is appraised at $2200. THe value of the neclace increases at an anhnual rate of 4%, so one year from today the necklace will be worth $
$2288.
Use a for loop to determine how much the necklace will be worth eacy year from now until 15 years from today. Store the values in a vector called "value".
This is what I have so far, but I need to store the following 1:15 in the value.
value = 2200;
for n=1:15
2200*1.04^n
end
Respuestas (1)
VBBV
el 14 de Abr. de 2021
%f true
value = 2200;
for n=1:15
V(n) = value*1.04^n
end
1 comentario
Tripp Moss
el 14 de Abr. de 2021
Categorías
Más información sobre Random Number Generation en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!