for idx = 1 hold on plot(idx,density(idx),"*") hold off pause(0.2) end showing incorrect
72 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(5 个)
KSSV
2022-7-6
density = density(:) ;
idx = (1:length(density))' ;
figure
plot(idx,density)
comet(idx,density)
0 个评论
Neyely Magnoly
2022-9-18
Envuelva el código de la segunda sección del script en tiempo real (líneas 4-7) en un bucle para que el código se ejecute 7 veces.
Asigne al contador de bucle el nombre idx. Para la primera ejecución del bucle, idx debe tener un valor de 1, que debe aumentar en 1 con cada iteración consecutiva.
0 个评论
ALI
2024-3-29,21:32
TASK
Wrap the code on lines 4–5 of the live script in a for loop so that the code executes 10 times.
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 in each consecutive iteration.
1 个评论
Sunil
2024-4-17,10:11
Wrap the code on lines 4–5 of the live script in a for loop so that the code executes 10 times.
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 in each consecutive iteration.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!