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

2 vues (au cours des 30 derniers jours)

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.

Réponses (3)

KSSV
KSSV le 6 Juil 2022
density = density(:) ;
idx = (1:length(density))' ;
figure
plot(idx,density)
comet(idx,density)

Walter Roberson
Walter Roberson le 18 Sep 2022
for idx = 1:MaximumNumberOfIterationsGoesHere

Yogesh
Yogesh le 22 Avr 2025
density = density(:) ;
idx = (1:length(density))' ;
figure
plot(idx,density)
comet(idx,density

Catégories

En savoir plus sur Numeric Types dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by