Write a matlab script m-file to play a guessing game the

Assignment Help MATLAB Programming
Reference no: EM13626304

Write a MATLAB script M-file to play a guessing game. The user will try to guess a number between 1 and 100. Your program will guide them to the right answer. Sample play should look like this:

Enter a number between 1 and 100 --> 50

Guess lower!

Enter your next guess --> 25

Guess higher!

Enter your next guess --> 33

Guess lower!

Enter your next guess --> 28

Congratulations! You got it in 4 guesses

Use the input command to obtain the guesses from the user. Note that you will be keeping track of how many guesses the user makes until the right answer is guessed.

This command generates a random number between 1 and 100: randi(100)

Optional improvements:

• Giving a special message for getting it on the first try.

• Giving a warning or error message if the user enters a number that is not between 1-100.

• Giving a warning or error message if the user does not enter a higher or lower number as instructed.

Reference no: EM13626304

Questions Cloud

Refrigerant-134a is being transported at 1kgs through a : refrigerant-134a is being transported at .1kgs through a teflon tube of inside diameter di 25mm and outside diameter
Moreover the manufacturer believes the lifetime of the : suppose a car manufacturer believes its windscreen wipers will last on average for three years on their cars if driven
Write a function that accepts an array a as input and : write a function that accepts an array a as input and searches the contents of the array for elements in three
Consider a 2210 lb automobile clocked by law enforcement : consider a 2210 lb automobile clocked by law enforcement radar at a speed of 85.5 mph. if the position of the car is
Write a matlab script m-file to play a guessing game the : write a matlab script m-file to play a guessing game. the user will try to guess a number between 1 and 100. your
What is the uncertainity in the position of an electron : german physicist werner heisenberg related the uncertainity of an objects position triangle x to the uncertainity in
A heat engine accepts 200000 btu of heat from a source at : a heat engine accepts 200000 btu of heat from a source at 1500 r and rejects 100000 btu of heat to a sink at 600 r.
Suppose tarzan leaps from the top of a 60-m tall building : suppose tarzan leaps from the top of a 60-m tall building. if his initial speed is 24 ms and at an angle of 23 degrees
A refrigerant at -40degc flows inside a copper pipe inside : a refrigerant at -40degc flows inside a copper pipe inside diameter 3 cm outside diameter 3.4 cm with a convective

Reviews

Write a Review

MATLAB Programming Questions & Answers

  Create a matlab program

Create a MATLAB program that will use MATLAB's fzero function to determine d for the following parameters: R = 0.5 m and in steps of 0.1. Create a table consisting of S and d .

  Calculate an approximation to the energy consumed

Calculate an approximation to the energy consumed over the period and calculate an approximation to the energy consumed over the period t = a to t = b.

  Perform gauss-jordan elimination

Write a matlab function to perform gauss-jordan elimination with pivoting. Modify the pivoting so that it is using the row with the highest absolute value rather than the first non-zero row.

  Matlab – discrete time simulation

MATLAB – Discrete time simulation, solve  Discrete time syetm problem,  DT kalman filter problem,  Steady state DT kalman filter problem

  Coding(using for and while loop)

coding(using for and while loop)

  Write a script that will prompt the user for the two areas

Write a script that will prompt the user for the two areas in square feet, and will print whether the velocity at the second point increases, decreases, or remains the same as the first point.

  Determine the volume of the pyramid

Determine the volume of the pyramid. When the user enters every value, they will then be prompted also for either 'i' for inches, or 'c' for centimeters.

  Lagrange interpolating polynomial of degree

Lagrange interpolating polynomial of degree

  Mat lab programming problem

In case the problem in the code I want you to modify it give the correct temperature.

  Estimation of the rayleigh limit

Propose a method that would allow estimation of the Rayleigh limit experimentally - Rayleigh frequency resolution limit

  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.

  Generate a sphere of diameter 3. create 3 vectors

Generate a sphere of diameter 3. Create 3 vectors representing the translation of this sphere along the x, y, and z axes. Generate the correct vectors given the description below: The sphere should be translated to (-10, -10, -10).

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