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

  Package design

Package Design Brief: Assume you are the packaging engineer for a large consumer products company. In this company, the Packaging Design Briefs are initiated by the marketing group and forwarded to the Package Engineering group.

  Mechanical engineering questions

Define dynamic viscosity, Determine the centroid, Pressure due to the height of liquid, Advantage of changing the liquid, Calculate the total moment about the hinge of the seal gate.

  Automatic control

DOF system and Find the differential equation describing the system

  Write a paper on boyle''s law

Write a paper on Boyle's law and describe Compression and Combustion stroke . Also explain Charles's law and illustrate SI engine and CI engine.

  Verify the law for parallelogram of forces

To Verify the law for parallelogram of forces, law for triangle of forces and law of polygon of forces. These laws are very useful to calculate unknown forces in very short time.

  Discharge pressure of the compressor

What is the discharge revised discharge pressure of the compressor.

  The Case for Global Accounting Standards

The role of IFRS in both developing and developed capital markets.

  Wind turbine

Wind turbines are becoming more and more common as a method of energy production, wind turbines by their very nature are dynamic and are subject to and create their own internal and external kinematics and kinetics.

  Advanced design methodologies

8 x product engineering and design review (week 2 – 12), ~3 pages per item which must contain a brief description of the product then delve into concepts such as materials selection, manufacturing methods, life cycle analysis, recyclability and overa..

  Design of absorption column and the cooler

Design of absorption column and the cooler. Process design of other units should be completed along with pipe sizes.

  Determine the maximum total bending moment

Determine maximum total bending moment (static plus dynamic) of the beam under steady-state conditions.

  Force of the water on the gate

Determine the magnitude of the horizontal and vertical components of the force of the water on the gate.

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