Respuesta aceptada

Dyuman Joshi
Dyuman Joshi el 26 de Ag. de 2023
x0 = 100;
r=1.02;
%Bring the assignment out of loop, as it is not affected by the loop
x = x0;
%Define indices to loop over
j = 1:5;
for k=j
x(k+1) = r*x(k);
end
%Plot with markers to show the data points
plot(j,x(j),'bo-')
grid on

Más respuestas (0)

Categorías

Más información sobre 2-D and 3-D Plots en Centro de ayuda y File Exchange.

Productos

Versión

R2015a

Etiquetas

Preguntada:

el 26 de Ag. de 2023

Respondida:

el 26 de Ag. de 2023

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by