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

  Create a function called freefall

Write a function called eapprox that takes the value of K as input and which them approximates e using the method described.

  Calculate the bending moment and shearforce diagrams

Matlab code that will calculate the bending moment and shearforce diagrams for the attached file. It must be possible to input lengths,udl values fro each element and the programme must calculate the reaction forces at A,B,C

  Does technology influence gambling

Can you conclude that online gambling is more prevalent among individuals who are under the age of 30 at a level of significance of 0.05?

  How do you create a new script or function in matlab

What is the difference between a script and function. How do you create a new script or function in MATLAB

  Matlab m-script that will generate a damped sinusoid

1.) Write a MATLAB m-script that will generate a damped sinusoid (frequency = 440 Hz) with a time constant of 0.25 sec. Set the time axis for 0 to 6 time constants.

  Stepper motor driven xy table

Stepper Motor Driven XY Table - Use Matlab and Labjack to acquire digital inputs from limit switches and use Matlab to analyze acquired data

  Develop research and lifelong learning skills

BE201 - Digital Communication Simulate digital communication applications using MATLAB and explain the need for sampling - Develop the skill to write professionally-looking technical reports.

  Determine and explain cost function and decision variables

Determine and explain the cost function and decision variables and define a problem of your choice which can be tackled by Biologically Inspired Methods.

  Compute the confusion matrix test_confusion of size

Summarize all of your results in a separate section at the end. Compare your results from Step 03, and Step 04. Which of the two algorithms yields the best result? Why?

  Fourier transform and biosignal analysis

Fourier Transform and Biosignal Analysis - series data into its frequency components for the purpose of signal analysis and processing.

  If the model tests are to be performed in a wind tunnel

the fluid dynamic characteristics of an airplane flying 240 mph at 10000 ft are to be investigated with the aid of a

  Matlab inline functions

Consider g(t)=e^(-2t) cos?(πt)(u(t)-u(t-2.5)), use Matlab inline functions for the following questions

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