Write additional syntax to create input variable named time

Assignment Help MATLAB Programming
Reference no: EM131214166

Algorithms Assignment

The following 3 tasks are to be completed for Homework 1 - using the following MATLAB syntax for the script file "bike.m"

1) Write additional syntax to create an INPUT variable named time and prompt the user for the amount of time pedaling the bicycle (in hours).

2) Then, create a distance calculation assigned to the variable distance that is equal to the variable time multiplied by the variable speed.

3) OUTPUT the calculated distance value using the fprintf function. What are the distance units? Include the units in the fprintf statement.

%bike.m - calculates speed of a bicycle in km/h
%define known input variable values
wheel = 622;
tire = 28;
fgear = 40;
rgear = 22;
%prompt user for cadence (can be a vector of multiple cadence values)
cadence = input('rpm: ');
%prompt user for time (amount of time pedaling) - HOMEWORK Q1
%caculate meters of development (modev) and speed
modev = (wheel + 2 * tire) * (fgear/rgear) * pi * 0.001;
speed = modev * cadence * 0.06;
%calculate distance traveled = time * speed - HOMEWORK Q2
%use the <fprintf> function to output "speed" in km/h
fprintf('The bicycle speed is: %g km/h\n', speed);
%use the <fprintf> function to output "distance" in kilometers - HOMEWORK Q3

Reference no: EM131214166

Questions Cloud

What is the final mean temperature of the water : An electric heater contains 40 litres of water initially at a mean temperature of 15 °C; - what is the final mean temperature of the water?
Values for the variable average jan temperature : Suppose you want to use the variable Latitude to estimate values for the variable Average Jan temperature. In this instance, identify in words which variable is the explanatory variable and which variable is the response variable.
Describe how data can be interpreted differently : Describe how data can be interpreted differently. Explain how and why data is scrubbed.
When would an extinction procedure be more beneficial : What are some of the possible areas of concern with punishment? Which do you feel is most concerning? When would an extinction procedure be more beneficial? How would you implement the procedure?
Write additional syntax to create input variable named time : Write additional syntax to create an INPUT variable named time and prompt the user for the amount of time pedaling the bicycle (in hours).
Determine the probabilities : The probability that a university graduate will be offered no jobs within a month of graduation is estimated to be 5%. The probability of receiving one, two, and three job offers has similarly been estimated to be 43%, 31%, and 21%, respectively. ..
What are appropriate long-term goals of this intervention : Did you observe any evidence of general medical conditions that might contribute to the development of this disorder? Did you observe any evidence of psychosocial and environmental problems that might contribute to this disorder?
Complete an expression of interest farm and nominate one : Globex have requested a computer-based system to replace their current manual processes to keep track of all of the RALS volunteers. Volunteers complete an expression of interest farm and nominate one or more volunteer roles they are interested in t..
Discussing the parking situation : Ross Times, the student newspaper of Ross College, printed a "What do you think?" column feature discussing the parking situation on campus. To gather student opinion on parking, an editor for the paper stood at the entrance to the student union a..

Reviews

Write a Review

MATLAB Programming Questions & Answers

  Write a program to display all unit-step responses

Write a program that will read in a text string mixed with numbers and letters from the keyboard and count how many numbers there are in the string

  Does the threshold increase or decrease with axon diameter

Write down your threshold amplitude and duration values in a table and enter into an mfile. Plot the current versus duration. This is called strength-duration curve.

  Find the mean stress level of the sample

Find the Mean stress level of the sample - find the Median stress level of the sample and find the Mode of the stress level for the students

  Write a code that will convert from ieee-754 floating-point

Convert from decimal to binary. Convert from binary to decimal. Convert from decimal to IEEE-754 format. Write a code that will convert from IEEE-754 floating-point representation to decimal.

  Write a simple program that stores the high temperatures

A meteorological company wants you to write a simple program that stores the high temperatures and low temperates for each of the months of the year. After consulting with trusted programming partners, you come up with a great idea

  Using matlab and for loops

Using MATLAB and for loops, provide an animation that follows the below steps: Start with a square at the origin with each side being 5 units long. Imagine someone kicked the box and animate it moving on a projectile motion trajectory. Hint: look at ..

  Process with the process that bertier used to resolve

Process with the process that Bertier used to resolve the situation - State how Gerry Bertier used each of the following steps in the decision-making process

  Write the matlab code to create a 1x3 vector

Write the MATLAB code to create a 1x3 vector containing the elements [1,2,3]. Additionally, write the MATLAB code to create a 3x1 vector with the same elements.

  Analyse the bar using the galerkin finite element method

Analyse the bar using the Galerkin finite element method. The coding solution for linear h-refinement and its manual solution for a limited number of linear elements areon Blackboard for your reference.

  Write a matlab routine data matrix containing a multivariate

Write a MATLAB routine A = ChowLiu(X) where X is a D × N data matrix containing a multivariate datapoint on each column that returns a Chow-Liu maximum likelihood tree for X.

  Define the transformation matrix

Define the transformation matrix for each vertex that keeps the approach of the knife normal to the circumference and oriented toward the cut, and makes the cut 1 cm deep.

  Describe the controller design problem

Design a proportional controller Gc(s), to meet the specifications. Can you meet all three specifications? If not, then explain - propose a controller Gc(s) to control the vertical height, Y(s), of rowdy. The figure 2 shows the block diagram of the..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd