Concept explainers
Write a MATLAB statement that results in the input request shown in bold. The >> shows where your statement is typed, and the | shows where the cursor waits for input. The display must be correctly positioned. Each has a space before the cursor (shown as |). The input variable name and the variable type are shown at the right.
- a. >>
Enter the length of the bolt in inches: | (bolt, a number)
- b. >>
Enter the company’s name: | (Company, text)
- c. >>
(In this statement, the window displayed will appear for the user to choose a color, and the result will be stored in the Variable LineColor.)
a.
Write a MATLAB statement to show the given input.
Answer to Problem 1ICA
The MATLAB statement to show the given input is written.
Explanation of Solution
Given data:
The given input is written as follows.
Enter the length of the bolt in inches:
Description:
Write the MATLAB statement to show the given input as follows.
bolt = input('Enter the length of the bolt in inches: ')
Press the Enter and obtain the required objective as follows.
Enter the length of the bolt in inches:
Conclusion:
Thus, the MATLAB statement to show the given input is written.
b.
Write a MATLAB statement to show the given input.
Answer to Problem 1ICA
The MATLAB statement to show the given input is written.
Explanation of Solution
Given data:
The given input is written as follows.
Enter the company's name:
Description:
Write the MATLAB statement to show the given input as follows.
Company = input('Enter the company''s name: ','s')
Press the Enter and obtain the required objective as follows.
Enter the company's name:
Conclusion:
Thus, the MATLAB statement to show the given input is written.
c.
Write a MATLAB statement to show the given input.
Answer to Problem 1ICA
The MATLAB statement to show the given input is written.
Explanation of Solution
Given Data:
The given input is a pop up menu, which asks the user to choose a color from Red, Green, and Blue.
Description:
Write the MATLAB statement to show the given input as follows.
LineColor = menu('Choose a color','Red','Green','Blue')
Press the Enter and obtain the required objective as follows.
If the user presses red, it shows the line color as 1.
LineColor =
1
Conclusion:
Thus, the MATLAB statement to show the given input is written.
Want to see more full solutions like this?
Chapter 18 Solutions
Thinking Like an Engineer: An Active Learning Approach (3rd Edition)
- write one command for each case: take data name is 'x' and file name is 'database' Import data form Excel sheet to MATLAB. 1. Export data form MATLAB to Excel sheet. 2. Save data as text file. 3. Load data form text file. 4. Open and close file.arrow_forwardCNC. Please write what each line of G- code means for each line. Thanksarrow_forwardDavid is working on her farming business and faces the challenge of watering her plants daily,which is a tedious and time-consuming task, especially under the scorching sun. The path shefollows for watering the plants is illustrated in figure 1.David's son has taken on the task of designing a prototype to automate the watering process forher. Figure 2 depicts the design, featuring a set of rods. The curved path represents David'stypical watering route, and the straight rod AB AB is confined to move along the path due to the pinsat its ends. Water sprinklers will be positioned at points A and B to efficiently water the plants.At the instant shown in figure 2, point A has the motion shown while its at the edge of the path.Determine the velocity and acceleration of point B at this instant.arrow_forward
- Pls answer correctly and corresponding to what is given in the image attached. The instructions are already in the image. Thank youarrow_forwardQ3: Write two G-code programs using the following figure where units are in inches. a. The first program should use absolute positioning, and b. the second program should use incremental positioning. P4 Finish (6, 4) P2 (1, 3) P3 (4.79, 2) P1 Start (-2, 1) Center (2.5, 1) -2arrow_forwardWrite a G-Code Program for the part given below. 10 20 40 30 R9 R20 R8 11,98 80 Start Re R7 SSarrow_forward
- The Pascal triangle can be displayed as elements in a lower-triangular matrix as shown on the right. Write a MATLAB program that creates a n × n matrix that displays n rows of Pascal’s triangle. Use the program to create 4 and 7 rows Pascal’s triangles. (One way to calculate the value of the elements in the lower portion of the matrix isarrow_forwardQ4/ write one command for each case: take data name is 'x' and file name is 'database' Import data form Excel sheet to MATLAB. 1. Export data form MATLAB to Excel sheet. 2. Save data as text file. MATLAB 3. Load data form text file. 4. Open and close file.arrow_forwardWhat is the error in the following code: x=[1:1:10]; y=[ 21 33 4 56 77 88 990 ; semilogy (x, y,'r--'); vectors must be the same lengths can't draw by semilogy x in not a vector there is no any error matlab (w = [1 0-9; 2 -2 0; 1 2 3]; ). What is the value of x(2,1) ? undefined O 2 O the whole second rowarrow_forward
- Ql: Write true or false a- The body is constant when no force effect of this. b- The moment is force x distance. c- Force is vector quantity. d- The force in the engineering dynamics is zero. e- Space is the geometric region for two coordinates and three coordinates. f- Particle is zero dimensions but have weight. g- Acceleration is a scaler quantity. h- We can use tan law to solve the problems. i- We use the plus in the cosine law when the angle between two force. j- Rivet between two plates is external force.arrow_forwardQ1/ Choose the correct answer (True or False) False O O True AutoCAD provides nine ways to draw an arc Line, Circle, Polyline, and Rectangle and so on and they are available in the modify panel of the ribbon AutoCAD is a CAD software package developed and marketed by Autodesk Inc AutoCAD measures the angle in counterclockwise direction The Rotate tool rotates an object or a group of objects about a base pointarrow_forwardA person by the name of Huebscher developed a relationship between the equivalent size of round ducts (in air conditioning applications) and rectangular ducts according to (ab) 0.625 (a + b)0.25' D = 1.3- Side of Rectangular Du 400 450 500 550 600 diameter of equivalent circular duct (mm) dimension of one side of the rectangular duct (mm) dimension of the other side rectangular duct (mm) Use VBA to create a custom-made dialog box to return values that shows the relationship between the circular and the rectangular duct dimensions, such as the values of D that would be entered into the table shown below. Length of one side of rectangular duct (length a), mm 125 150 175 122 133 143 122 133 143 122 133 143 122 133 143 122 133 143 where we have the following: D= 100 109 109 109 109 109 a= b= 200 152 152 152 152 152 Calculate Diameterarrow_forward
- Elements Of ElectromagneticsMechanical EngineeringISBN:9780190698614Author:Sadiku, Matthew N. O.Publisher:Oxford University PressMechanics of Materials (10th Edition)Mechanical EngineeringISBN:9780134319650Author:Russell C. HibbelerPublisher:PEARSONThermodynamics: An Engineering ApproachMechanical EngineeringISBN:9781259822674Author:Yunus A. Cengel Dr., Michael A. BolesPublisher:McGraw-Hill Education
- Control Systems EngineeringMechanical EngineeringISBN:9781118170519Author:Norman S. NisePublisher:WILEYMechanics of Materials (MindTap Course List)Mechanical EngineeringISBN:9781337093347Author:Barry J. Goodno, James M. GerePublisher:Cengage LearningEngineering Mechanics: StaticsMechanical EngineeringISBN:9781118807330Author:James L. Meriam, L. G. Kraige, J. N. BoltonPublisher:WILEY