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 17 Solutions
Thinking Like an Engineer: An Active Approach, Student Value Edition Plus MyLab Engineering with Pearson eText - Access Card Package (4th Edition)
- I need only MATLAB coding please.....arrow_forward6.1Complete the code please.arrow_forwardImportant instruction: This question uses the last three-digit value (L3D) of individual student matrix number. For example, if the matrix number is CD180264 then the L3D value is 264 (since the last three digits is 264). Some data require multiplication of the L3D value, for examAdditional instruction: These questions use the last three-digit value (L3D) of individual student matrix number. Example, if the matrix number is CD180264 then the L3D value is 264 (since the last three digits is 264). Some data require multiplication of the L3D value, for example 10(L3D) means 10 x L3D.ple 10(L3D) means 10 x L3D. subject name isarrow_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_forwardUse graphical method to solve (Resolution and Composition).arrow_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
- Briefly discuss how each of the following is used by CFD codes to speed up the iteration process: (a) multigridding and (b) artificial timearrow_forward2. Write a MATLAB script that computes the following sum while requesting the value of x and n from the user.arrow_forwardWe have designed a divide-and-conquer algorithm that runs on an input of size n. This algorithm works by spending O(1) time splitting the problem in half, then does a recursive call on each half, then spends O(n2 ) time combining the solutions to the recursive calls. On small inputs, the algorithm takes a constant amount of time. We want to see how long this algorithm takes, in terms of n to perform the task. (a) First, write a recurrence relation that corresponds to the time-complexity of the above divide and conquer algorithm. (b) Then, solve the relation to come with the worst-case time taken for the algorithm. Please show all work in depth.arrow_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