I want to design Raster path on Matlab

조회 수: 1 (최근 30일)
Muhammad Mubashar saeed
Muhammad Mubashar saeed 2021년 4월 28일
댓글: Muhammad Mubashar saeed 2021년 4월 28일
I want to define it as a function of t

답변 (1개)

Walter Roberson
Walter Roberson 2021년 4월 28일
Let the horizontal length be H and the vertical jog be V. Then one full cycle is distance 2*(H+V); suppose that it is to be completed in time P (the period.)
WIthin the first period, the horizontal position goes like
s = 2*(H+V)/P; %speed
x = piecewise( MOD(t,P) <= H/P, H-mod(t,P)*s, ...
MOD(t,P) > H/P & MOD(t,P) <= (H+D)/P, 0, ...
MOD(t,P)>(H+D)/P & MOD(t,P) <= (D+2*H)/P, mod(t-D-H,P) * s, ...
MOD(t,P)>(D+2*H), 0)
and you can define the vertical position by similar means, except that the vertical position progresses by 2*D for every full period.
Above, MOD should not be implemented as mod() unless you have R2020b or later. Instead
MOD = @(val,period) val - floor(val/period)*period
This is because in earlier releases, mod() of a symbolic expression gets a bit odd and difficult to work with.
  댓글 수: 2
Muhammad Mubashar saeed
Muhammad Mubashar saeed 2021년 4월 28일
Thank you so much. Can you please explain this as well "you can define the vertical position by similar means, except that the vertical position progresses by 2*D for every full period".
Muhammad Mubashar saeed
Muhammad Mubashar saeed 2021년 4월 28일
Can you please send me the detail code. It shall be a great favour from your side.

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

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by