Input statement to expect a string

Assignment Help Mechanical Engineering
Reference no: EM131031306

Write a script file that does the following:

  • Prompts the user for the name of his/her jpg file using an input statement.  Set up your input statement to expect a string.
  • Uses the imread command to read in the jpg image.  Note: the filename will already be a string so don't use single quotes around it again.
  • Converts the color image to a grayscale image called Pic.
  • Prompts the user for a Threshold value from 0 to 255.
  • If the user enters an invalid value for Threshold, the script continues to prompt the user for a valid value until the user finally manages to follow directions.
  • Determine the size of Pic.
  • Create a new matrix called NewPic which is the same size as Pic, contains all zeros, and is type uint8.  Note: everything in MATLAB defaults to a double.  Use the uint8 function to convert to this variable type.  Ex.  M = uint8(M) will convert an array M to type uint8.
  • Use the conversion formula given above and the value of Threshold entered by the user to make NewPic a pure black and white image.
  • Use the imshow command to display the original grayscale image.  Add a title indicating that this is the original image.
  • Use the command figure to open a new figure window then use the imshow command to display the black and white image.  Add a title indicating that this is the Black and White image.

Reference no: EM131031306

Questions Cloud

Calculate the minimum natural frequency of a hydraulic : Calculate the minimum natural frequency of a hydraulic cylinder (L = 25 cm and D = 4 cm) connected to a 45 kg load when the hydraulic fluid is (a) an oil with B = 1.7 GPa and (b) water with B = 2.2 GPa.
Association between marital status and income : 1. Suggest several lurking variables that might help explain the association between marital status and income.
Bundles of protein filaments inside tissue cells : Force against the materials to which they adhere. Figure 3 shows struts called "stress fibers" that extend from one end of the cell to the other. These fibers are made of crosslinked, filamentous actin, with an average diameter of 2 µm and an effecti..
Would king and queen be liable to efl : Would King & Queen be liable to EFL? Provide specific case references to support your answer. Would your answer change if EFL had written to King & Queen advising you that they intended to make a loan to Impulse and were relying on the 2012 audited..
Input statement to expect a string : Prompts the user for the name of his/her jpg file using an input statement.  Set up your input statement to expect a string.Uses the imread command to read in the jpg image.  Note: the filename will already be a string so don't use single quotes arou..
Pregnancy and children later test scores : Suggest some lurking variables that may help explain the association between smoking during pregnancy and children's later test scores. The association by itself is not good evidence that mothers' smoking causes lower scores.
Write a response in which you state your position : On the whole, is going to a summer sleep-away camp as a child a positive experience or a negative one? Why? Plan and write a response in which you state your position and persuade readers to agree with you.
How many surgeries must be performed on average per day : A hospital only provides care to hernia patients. Each patient spends 4 nights at the hospital. This includes preparation of the patient before the hernia surgery and recovery after the hernia surgery. As a new initiative, The hospital tries to adopt..
Determine the final temperature of the water : The partition is now removed, and the water expands to fill the entire tank. Determine the final temperature of the water and the volume of the tank for a final pressure of 10 kPa

Reviews

Write a Review

 

Mechanical Engineering Questions & Answers

  A commercial heat pump has energy in to the system at a

a commercial heat pump has energy in to the system at a rate of 60 kw from a thermal reservoir. ifnbspthe power input

  Determine the quality of the steam at the turbine exit

Consider a 210-MW steam power plant that operates on a simple non-ideal Rankine cycle, where the isentropic efficiency for both the turbine and the pump is 85%. Steam enters the turbine at 10 MPa and 500C and is cooled in the condenser at a pressure ..

  The crate slides down the section of the spiral ramp such

the crate slides down the section of the spiral ramp such that r 0.5z ft and z 100 - 0.1t2 ft where t is in seconds.

  Security engineering and infrastructure security engineering

1. Explain the important differences between application security engineering and infrastructure security engineering. 2. For the MHC-PMS, suggest an example of an asset, exposure, vulnerability, attack, threat, and control.

  Determine the heat transfer from a single fin

A radiator wall measuring 2 m by 3 m (WxH) is held a temperature of 125 °C. Straight aluminium fins (k = 175 W/mK) are to be mounted on the wall. The fins are 5 cm in length and 0.8 mm thick. The system is allowed to convectively transfer heat to amb..

  Saturated water vapor has a specific volume of 077012 m3kg

water at a temperature of 75 oc has an internal energy of 1800 kjkg. what is its state? water with a specific volume of

  Natural gas fired plants at these prices and express the

suppose that coal costs 45ton at the power plant fuel oil costs 60bbl 1 bbl has appoximately 6?106 btu 6 mmbtu and

  Temperature deratings in addition to the options you

you are looking for a power unit to run an irrigation pump in your operation. the pump requires 92 horsepower to turn

  A load of 275x106 g produces a 0327 cm diameter impression

a brinell hardness measurement is made on a nickel alloy using a 0.01 m diameter sphere of tungsten carbide. a load of

  Determine the exit velocity in fts and the exit temperature

steam at 500 lbfin2 500 f enters a well insulated valve operating at steady state with a mass flow rate of .11 lbs

  Determine the pump power required to generate this water

a cutting tool uses a nozzle that generates a high speed jet of liquid water water temperature 20 degc. assume an exit

  Determine the temperature rise of the contents after 08 h

a motor delivers 240 w through the drive shaft to a paddle wheel that agitates liquid water in a closed insulated tank

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