Question: You are given a script that simulates N steps of a marker along x . Your task is to compute the total distance travelled by
You are given a script that simulates steps of a marker along Your task is to compute the
total distance travelled by the marker assign the result to d You should do this by adding
your own lines of code to the existing script. Ideally, you will
add code to line # to initialize d;
add code to line # to update ;
optional add code at the very end line # to display d;
Note that the following lines in the template are locked you are unable to edit them:
and
Hint: consider using a builtin function called abs for finding the absolute value feel free to
look it up using MATLAB Help
Script
;
randi;
for :
stepsize randi;
stepsize
end
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
