plot3 bunch of particles

조회 수: 3 (최근 30일)
JORGE ORDOÑEZ CARRASCO
JORGE ORDOÑEZ CARRASCO 2022년 2월 10일
댓글: JORGE ORDOÑEZ CARRASCO 2022년 2월 10일
Hi everyone actually matlab got frozen (it has about 20 minutes), cause i was trying to plot 1000 particles in 3D. I have a data set of particles contained in S. But runing that part bellow takes about 15 minutes. Is there any short cut to do it faster. I have a code implemented which updates the particle position in every step, i need to track down all particles and create a video of their behavior. Matlab is powerful and fast plotting 1000 particles and got frozen is weird, any suggestion? Thank you.
inde=1:1:1000;
for i=1:1000
figure(1)
hold on
plot3(S(inde(i),1),S(inde(i),2),S(inde(i),3),'*')
hold off
end

채택된 답변

David Hill
David Hill 2022년 2월 10일
scatter3(S(:,1),S(:,2),S(:,3));
  댓글 수: 1
JORGE ORDOÑEZ CARRASCO
JORGE ORDOÑEZ CARRASCO 2022년 2월 10일
Genius, thank you man it makes it really fast.It worked. Im so grateul.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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

태그

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by