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

  The roller-coaster track shown is contained in a vertical

the roller-coaster track shown is contained in a vertical plane. the portion of track between a and b is straight and

  One us gallon is equivalent to 01337 ft3 1 ft is

one u.s. gallon is equivalent to 0.1337 ft3 1 ft is equivalent to 0.3048 m and 1000ml are equivalent to m3. by using

  Predict the discharge of a larger geometrically similar

a small model of a pump is tested in the laboratory and found to have a specific speed n equal to 1000 when operating

  Air conditioner maintains the temperature of a dwelling

An air conditioner maintains the temperature of a dwelling at 72 0F when it is 96 0F outside. If heat is transferred through the walls and ceiling at 35,000 BTU/hr. a) What is the minimum power required to run the air conditioner in hP and b) calcula..

  When this happens the coefficient of friction between

a 700 kg automobile is traveling at 30 msec when it suddenly applies its breaks and lock the wheels. when this happens

  An accelerometer mounted inside the train records a

a train enters a curved horizontal section of track at a speed of 100kmh and slows down with constant deceleration to

  Find the lowest mass flow rate at which water could be

water from a reservoir maintained at 20 deg c is pumped steadily along a horizontal pipe from which it is discharged

  Calculate overall heat transfer coefficient of material mild

Calculate overall heat transfer coefficient (U) of material mild steel for a heat transfer from hot water to air at ambient temperature where thinkness is 1.5 mm (avg temp of hot water is 75C and air is 56C) not by using Q = U A log mean temperature ..

  Find the heat transfer and work per unit mass of air in

consider an air-standard otto cycle and a modified cycle in which the isentropic compression and expansion processes

  Plot the temperature distribution along the line normal to

a 40 cm diameter pipe at 75 degree c is buried in a large block of portland cement. it runs parallel with a 15 degree c

  Knowing that the coefficient of static friction is 020 at

the machine part abc is supported by a frictionless hinge at b and a 10degree wedge at c. knowing that the coefficient

  Calculate the time the boy must wait until the surface

a boy places his glass marbles in an oven at 200degreec. the diameter of the marbles is 15 mm. after a while he takes

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