Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I got really enormous stress about this: Matlab coding and for loop. help please Introduction This problem gives you practice with for loops that employ

I got really enormous stress about this:

Matlab coding and for loop.

image text in transcribed

image text in transcribed

help please

Introduction This problem gives you practice with for loops that employ vector indexing. Be sure to follow good programming standards in your script. Problem You are planning an exercise schedule with daily exercise minutes. The schedule must follow these guidelines: Assign a 30-minute run to every odd numbered day (i.e., every other day). Assign a 45-minute run to every even numbered day (i.e., every other day). One day every two weeks will have a 90-minute sports day that replaces the scheduled run. The first instance will happen in the first week. One day per week will be a rest day (i.e., 0 minutes) that replaces the scheduled run. You must write a MATLAB script that will create an exercise plan using the guidelines. Your script must do the following: Create an Nx7 array that contains the numeric value for number of minutes to exercise each day. The 1st column of the array corresponds to Mondays. N is the number of weeks in the schedule. Use only for loops to fill out the schedule array. You can use as many for loops as you want. Ask the user to input information: How many days must be in the exercise schedule? Assume this number will always be divisible by 7 so the schedule does not include an incomplete week. What day of the week will be the sports day (assume Monday is Day 1, Tuesday is Day 2, etc.)? What day of the week will be the rest day (using the same day numbers as above)? Follow good programming standards. Initialize the different exercise minutes as variables. Do not hardcode values that are assigned to variables within the script. Display to the Command Window the final schedule as an array with each row containing 7 days, where Day 1 is a Monday of the first week, Day 8 is Monday of the second week, etc. Make sure to display the label of the days of the week in the correct order along with the numeric array. Hint: Create a string vector with the names of days to display. Hint: Remember that you can use linear indexing to index array elements in a matrix. When your script in running properly, run it with the following inputs: Input value 35 Input item Number of days in schedule Day of week for the sports day Day of week for the rest day 4 5

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_2

Step: 3

blur-text-image_step3

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2017 Skopje Macedonia September 18 22 2017 Proceedings Part 3 Lnai 10536

Authors: Yasemin Altun ,Kamalika Das ,Taneli Mielikainen ,Donato Malerba ,Jerzy Stefanowski ,Jesse Read ,Marinka Zitnik ,Michelangelo Ceci ,Saso Dzeroski

1st Edition

ISBN: 3319712721, 978-3319712727

More Books

Students also viewed these Databases questions

Question

How is the NDAA used to shape defense policies indirectly?

Answered: 1 week ago

Question

1. PricewaterhouseCoopers

Answered: 1 week ago

Question

3. SCC Soft Computer

Answered: 1 week ago