Question: Write a function in MATLAB called penMotion. It should take two arrays as input, one containing the x - coordinates of the pen stroke, and
Write a function in MATLAB called penMotion. It should take two arrays as input, one containing the x
coordinates of the pen stroke, and one containing the coordinates. The function should
return two arrays. The first should contain the arclength value of each point on the stroke,
and the second should contain the pen speed at each point. The values must be returned in
that order.
The arc length, of the point on the stroke is computed as:
The first data point has an arc length value of zero.
The speed, of the point on the stroke is computed as:
where is the time between the two data points, which we will assume is This
assumption is valid if the data points are sampled at a constant rate. Also, assume that the
first point on the stroke has a speed of zero, as it is not possible to calculate the speed using
this equation.
Hint: Your loops for computing arc length and speed should exclude the first data point on
the stroke.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
