2D vector field video quiver

조회 수: 8 (최근 30일)
mehtap agirsoy
mehtap agirsoy 2021년 6월 29일
댓글: mehtap agirsoy 2021년 6월 29일
Hey guys,
I wrote a code to create 2D flow field but there are some strangeness in my vector plot and the video. When I zoom the vector field there are lots of velocity vectors at the same point and in the video after a few msec previous vector fields are frozen on the screen and the rest flow over them. I don't understans the reason so i couldn't fix my code. If you're able to help I would be appreciate it. Thanks in advance.
  댓글 수: 3
mehtap agirsoy
mehtap agirsoy 2021년 6월 29일
Sorry, attached wrong file, updated it. I use same data for different analysis. Thanks
mehtap agirsoy
mehtap agirsoy 2021년 6월 29일
For each iteration it plots the previous vakues also. For example for the 5th iteration it plots 5 vectors at the same point but it should just plot the 5th one.

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

채택된 답변

Bjorn Gustavsson
Bjorn Gustavsson 2021년 6월 29일
You seem to never release the hold on the plots - the result is that all subsequent plots are added to the current one. So somewhere after your call to videoWriter do a hold off and move the hold on call to after the first plotting command in the loop. That way you will wipe the contents in the axes. You could also do a clf after the videoWriter-call.
HTH
  댓글 수: 1
mehtap agirsoy
mehtap agirsoy 2021년 6월 29일
got it, it works now, thanks a lot

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by