Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 y-coordinates. The function should
return two arrays. The first should contain the arc-length 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, s(i), of the ith point on the stroke is computed as:
si=si-1+(xi-xi-1)2+(yi-yi-1)22
The first data point has an arc length value of zero.
The speed, v(i), of the ith point on the stroke is computed as:
vi=(xi-xi-1)2+(yi-yi-1)22ti-ti-1
where ti-ti-1 is the time between the two data points, which we will assume is 1.(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.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft SQL Server 2012 Unleashed

Authors: Ray Rankins, Paul Bertucci

1st Edition

0133408507, 9780133408508

More Books

Students also viewed these Databases questions

Question

In bookkeeping, why are revenues credits?

Answered: 1 week ago

Question

1. Television more Over watching faceing of many problems ?

Answered: 1 week ago

Question

Is there a link between chronic stress and memory function?

Answered: 1 week ago