Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help with this Matlab program Homework #4 1. [Submit on zyLabs] Loops are very useful for doing the same calculation over and over, very

Please help with this Matlab program image text in transcribed
image text in transcribed
Homework #4 1. [Submit on zyLabs] Loops are very useful for doing the same calculation over and over, very quickly In this problem, we will use a loop to call a function with different inputs, and store the result in an array You are doing an experiment where you are trying to experimentally calculate the air resistance on falling objects. To calculate this resistance, you build an apparatus that will release objects with different initial velocities at different distances. You also set up a system for measuring the exact time it takes each object to fall. To do your air resistance calculation, you need a theoretical comparison for the amount of time it takes an object to fall in a vacuum. Thankfully you already have that function (please download fallTime.m from Canvas)! What you do not have yet is a way to call that function repeatedly for all of the distance and velocity data you have! Write a function called timeLoop. It should take two inputs, arrays for initial velocity and distance. These two input arrays will always have equivalent lengths, as the indices of these arrays correspond to the same data point from your experiment. It should return one output, an array for the theoretical amount of time it would take for the object moving at that initial velocity to fall that distance. To accomplish this task, you should call fallTime.m inside of a loop. For example, if you called timeLoop with the input array (2-3 5] for initial velocities (negative numbers mean the object was moving upwards initially) and (100 150 300] for distances, your function call and resulting output would look like this: times - timeLoop ([2, -3, 5), (100, 150, 300)) times 4.3160 5.84437.3275 This function calculates how long it takes an object to fall a certain distance given a certain initial velocity and a distance function time = fallTime (stactYelacity..distance), g = 9.81; %m/s^2 finalVelocity = sqrt(startVelocity^2 + 2*g*distance); m/s time = (finalVelocity - startVelocity)7g; %

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

Semantics In Databases Second International Workshop Dagstuhl Castle Germany January 2001 Revised Papers Lncs 2582

Authors: Leopoldo Bertossi ,Gyula O.H. Katona ,Klaus-Dieter Schewe ,Bernhard Thalheim

2003rd Edition

3540009574, 978-3540009573

More Books

Students also viewed these Databases questions

Question

1. Identify and control your anxieties

Answered: 1 week ago