필터 지우기
필터 지우기

how to crate an animated histogram

조회 수: 7 (최근 30일)
Georgia Muller
Georgia Muller 2018년 9월 16일
답변: Zenin Easa Panthakkalakath 2018년 9월 25일
Write the code to produce an animation of the histogram of particle counts over time using a for loop. Write the code to produce the animation, given that the variables M, N, Delta, x and L already exist in the work space. The code just needs to produce the animation in MATLAB.

답변 (1개)

Zenin Easa Panthakkalakath
Zenin Easa Panthakkalakath 2018년 9월 25일
You can use a combination of for loop, pause and drawnow. For example,
figure();
x=[0 1];
for i = 1:10
y=round(rand(100,1));
hist(y,x)
drawnow;
pause(0.1)
end

카테고리

Help CenterFile Exchange에서 Animation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by