for idx = 1 hold on plot(idx,density(idx),"*") hold off pause(0.2) end showing incorrect
72 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Usman Muhammad Lawan
el 6 de Jul. de 2022
Respondida: Sunil
el 17 de Abr. de 2024 a las 10:11
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 comentarios
Respuestas (5)
KSSV
el 6 de Jul. de 2022
density = density(:) ;
idx = (1:length(density))' ;
figure
plot(idx,density)
comet(idx,density)
0 comentarios
Neyely Magnoly
el 18 de Sept. de 2022
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 comentarios
ALI
el 29 de Mzo. de 2024 a las 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 comentario
Walter Roberson
el 29 de Mzo. de 2024 a las 22:02
It is not clear that this solves the problem the user posted about?
Sunil
el 17 de Abr. de 2024 a las 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 comentarios
Ver también
Categorías
Más información sobre Loops and Conditional Statements en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!