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

  Cell that faces convective and radiative ht transfer

Steel-reinforced concrete pillars are used in the construction of large buildings. Structural failure can occur at high temperatures due to fire because of softening of the metal core. Consider a 200mm thick composite pillar consisting of central ste..

  What will be the weight of metal in the shell

It is desired to purchase a steel tank to store 20,000 US gallons of liquid propane; design pressure is 250 psig, and design stress is 20,000 psi. For steel, SG = 7.9. What will be the weight of metal in the shell (excluding foundation, valves, manho..

  What is the temperature at the outer surface of the

a very thin and long pipeline used for the transport of crude oil is buried in the earth such that its centerline is a

  What is the work done on the bullet how does this change if

a 9 mm xian short-barreled experimental pistol is fired and the explosive gases push the friction-free bullet out of

  Accelerometer is used to measure vibration of a motor mount

An accelerometer is used to measure vibration of a motor mount. The steady state vibration has amplitude of 10g at a frequency of 7.5 Hz.

  A heat pump supplies 40 kw of heat to maintain the inside

a heat pump supplies 40 kw of heat to maintain the inside of a house at 25c in cold winter months when the ambient

  Determine the number of complete revolutions

A mixing drum is accelerated from 50 to 160 rpm in a time of 20 s by a driving torque of 25 Nm. Determine (a) the angular acceleration, (b) the number of complete revolutions turned, (c) the work done, (d) the average power developed, (e) the maxi..

  Deterimine reaction exerted by the groung on the airs

the 1-Mg forklift is used to raise the 750-kg crate with acceleration of 2 m/s. deterimine reaction exerted by the groung on the airs of wheel at A and B.

  Determine the entropy change of the air will this process

in a piston cylinder device 5kg of air at 200kpa and 227oc is compressed to 500kpa at 100oc. determine the entropy

  Volume and height of the cooling tower-relative humidity

A counter flow cooling tower cools 2000 gal/min water from 104 F to 85 F with 210,000 ft^3/min of air at 90 F Dry bulb Temperature and 76 F WBT. The Mass transfer coefficient -surface area product is hA= 123lbm/hr ft^3. Air mass flow rate per unit cr..

  The water now undergoes a process until its volume is

the spring-loaded piston-cylinder device is filled with 0.5 kg of water vapor that is initially at 4 mpa and 400oc.

  What is the sine wave generated by a phasor

what is the sine wave generated by a phasor of length 9, rotating with an angular velocity of 325 rad/s; and with the phase angle of 0."

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