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
Walter Roberson
2024년 3월 29일 22:02
It is not clear that this solves the problem the user posted about?
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!