Question

Function Name: runBabyRun Inputs: (double) Target distance to run before half-marathon (double) A 4x7 array of...

Function Name: runBabyRun

Inputs:

(double) Target distance to run before half-marathon

(double) A 4x7 array of miles run each day in the month of February

Outputs:

(double) The most improvement made between consecutive days

(logical) Whether you met your target distance for a single run

(double) 1x4 vector of how many total miles you ran each week

Function Description:

With this New Year, you decide that you are actually going to run that half-marathon that has been on your calendar for three years now. You have a month to prepare for your race, so you decided to record how many miles you run each day and aim to run a target distance before the race; if you can run this many miles, then you will feel officially half-marathon ready!

The month is now over and your race is tomorrow, so you decided to look back and see the progress that you have made.

First, check the greatest mileage increase made between any two consecutive days. Next, check whether the number of miles run on any one day met the target distance you set before training (the number of miles will

0 0
Add a comment Improve this question Transcribed image text
Answer #1

function [imp1 prep1 miles1] = runBabyRun(targetDistance, arr)


len = size(arr);
  
imp1=0;
prep1=false;
miles1 = zeros(1,len(1));
  
for i= 1:len(1)
for j=2:len(2)
diff= arr(i,j)-arr(i,j-1);
  
if imp1 < diff
imp1=diff;
end
end
  
for j=1:len(2)
if targetDistance <= arr(i,j)
prep1=true;
end
  
miles1(i) = miles1(i) + arr(i,j);
end
  
  
end

end


[imp1 prep1 miles1] = runBabyRun(
3.4,
[2.1 3.4 1.1 5.3 3.7 1.5 .5; 4.5 6.7 9.2 4.3 1.2 7.7 4.4; 6.7 13.6 8.7 3.5 6.5 8.3 5.4; 9 9.7 6.5 4.5 0 3.9 2.3]
)

---------------------------------------------------------------------------------------------------------------------------------------------------------

function TF = sudokuIsSolved(S)
TF = all(S(:));
end


input = sudokuIsSolved([ 8 2 4 9 5 3 6 7 1
6 3 5 8 1 7 9 2 4
7 1 9 6 2 4 8 5 3
5 8 7 2 9 1 3 4 6
1 4 2 7 3 6 5 8 9
3 9 6 4 8 5 2 1 7
2 6 1 5 4 9 7 3 8
4 7 8 3 6 2 1 9 5
9 5 3 1 7 8 4 6 2 ])

input = sudokuIsSolved([ 8 2 4 9 5 3 6 7 1
6 3 5 8 1 7 9 2 4
7 1 9 0 2 4 8 5 3
5 8 7 2 9 1 3 4 6
1 4 2 7 3 0 5 8 9
3 9 6 4 8 5 2 1 7
2 6 1 5 4 9 7 3 8
4 7 8 3 6 2 1 9 5
9 5 3 1 7 8 4 6 2 ])

Add a comment
Know the answer?
Add Answer to:
Function Name: runBabyRun Inputs: (double) Target distance to run before half-marathon (double) A 4x7 array of...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Function Name: stPaddysFeast Example search- Inputs 1 (struct) A MxN structure array 2. double) A...

    Using MATLAB, please read question well Function Name: stPaddysFeast Example search- Inputs 1 (struct) A MxN structure array 2. double) A 1x2 vector of your starting position: [row, column] next: [1, 3] next: [1, 1] next: [2, 1) food: 'potato food potato next: 2, 3] step 2 food: start next: [2, 2] food: 'potato' step 3 Outputs next [1, 21 food: food: 1. (ohar)A descriplion of how mary potatoes you found ad where you stopped looking step 4 (stop) Background...

  • Hello, I was wondering if you help me with mine accounting problem, Exercise 2.2 page 43 in the book Workplace Communication The Basics Canadian Edition. EXERCİSES 43 In Exercises dify del, for Exerci...

    Hello, I was wondering if you help me with mine accounting problem, Exercise 2.2 page 43 in the book Workplace Communication The Basics Canadian Edition. EXERCİSES 43 In Exercises dify del, for Exercise 2.1 You're the assistant to the personnel manager of a metals fabrication plant. Monday is Labour Day, and most of the 300 employees will be given a paid holiday. The company is under pressure, however, to meet a deadline. Therefore, a skeleton force of 40-all in the...

  • Today is Thursday , three days before your meeting begins. You are on-site in Rio de...

    Today is Thursday , three days before your meeting begins. You are on-site in Rio de Janeiro , and all is going well so far. Your destination management company (DMC) has been keeping track of the inevitable arrival changes. Your team is getting welcome packets together, incorporating last-minute changes into the day-by-day schedule, checking VIP amenities, and preparing for the next morning's arrival of your boss and several other senior managers. Good news! Your project coordinator has just verified that...

  • Code is in C# Your instructor would like to thank to Marty Stepp and Hélène Martin...

    Code is in C# Your instructor would like to thank to Marty Stepp and Hélène Martin at the University of Washington, Seattle, who originally wrote this assignment (for their CSE 142, in Java) This program focuses on classes and objects. Turn in two files named Birthday.cs and Date.cs. You will also need the support file Date.dll; it is contained in the starter project for this assignment. The assignment has two parts: a client program that uses Date objects, and a...

  • Systems Analysis Read the following scenario and answer the questions below. A company hires out ...

    Systems Analysis Read the following scenario and answer the questions below. A company hires out property renovation equipment (for example floor sanders, polishing machines, paint sprayers, sandblasters, scaffolding, etc.) to customers. Traditionally, they have used paper based records, but now they want customers to be able to rent out equipment online, or in person from the reception desk. When dealing with a booking, or allocating an available item to a customer, the new system needs to check whether the customer...

  • Systems Analysis Read the following scenario and answer the questions below. A company hires out property...

    Systems Analysis Read the following scenario and answer the questions below. A company hires out property renovation equipment (for example floor sanders, polishing machines, paint sprayers, sandblasters, scaffolding, etc.) to customers. Traditionally, they have used paper based records, but now they want customers to be able to rent out equipment online, or in person from the reception desk. When dealing with a booking, or allocating an available item to a customer, the new system needs to check whether the customer...

  • making a file You are tasked with creating a text-based program for storing data on Hotel...

    making a file You are tasked with creating a text-based program for storing data on Hotel Room Bookings - however, as this is a comparative languages course, you will be creating the same application in the following three programming languages: • Java, • Python, and • Lisp As you implement the application in each language you should keep notes on: - The features of the languages used, - Which features you found useful, and - Any issues or complications which...

  • ENT 210: The Management Process of Entrepreneurs Week 4, Chapter 12 Case Study Assignment DUE DATE:...

    ENT 210: The Management Process of Entrepreneurs Week 4, Chapter 12 Case Study Assignment DUE DATE: Wednesday, February 13 25 Points There is a concluding case titled “The Law Offices of Jeter, Jackson, Guidry, and Boyer” at the end of the chapter on pages 465 - 466. As you read this short case, think about how the concepts from this chapter apply to what you are reading. CASE – 4 The Law Offices of Jeter, Jackson, Guidry, and Boyer THE...

  • How does this article relate to the factors of productions in economics? From Music to Maps,...

    How does this article relate to the factors of productions in economics? From Music to Maps, How Apple’s iPhone Changed Business Ten years ago, hailing a cab meant waiving one's arm at passing traffic, consumers routinely purchased cameras, and a phone was something people made calls on. The iPhone, released a decade ago this month, changed all of that and more, sparking a business transformation as sweeping as the one triggered by the personal computer in the 1980s. Apple Inc.'s...

  • SECTION A (50) Read the case study below and answer the questions. SHORT RUN STABILIZATION AND...

    SECTION A (50) Read the case study below and answer the questions. SHORT RUN STABILIZATION AND LONG RUN COMPETITIVENESS: THE LAVITAN CASE Growth of a young country Latvia – a small, young country on the east coast of the Baltic Sea – has recently earned the title of a ‘‘tiger’’. After gaining its independence from the Soviet Union in 1991, the country embarked upon a challenging road of transitioning from a planned to a market economy. The first decade proved...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT