for idx = 1 hold on plot(idx,d​ensity(idx​),"*") hold off pause(0.2) end showing incorrect

Name your loop counter idx. For the first execution of the loop, idx should have a value of 1, and it should increase by 1 each consecutive iteration.

Respuestas (3)

density = density(:) ;
idx = (1:length(density))' ;
figure
plot(idx,density)
comet(idx,density)

Categorías

Más información sobre Startup and Shutdown en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 6 de Jul. de 2022

Comentada:

el 22 de Abr. de 2025

Community Treasure Hunt

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

Start Hunting!

Translated by