For each of the following problems except part (h), write a single MATLAB statement that will accomplish the stated purpose.
a. Create a 150 × 150 matrix N9999 that contains all zeros except for the major diagonal (upper left to lower right). All elements on the major diagonal should contain the value -9999.
b. Create a 1200 × 1200 matrix p75 that contains all zeros except for the minor diagonal (lower left to upper right). All elements on the minor diagonal should contain the value 75.
c. Place the number of rows of matrix Ma into MaRows and the number of columns of matrix ma into maCols.
d. Assume matrix my. contains a single nonzero value. Place the row number containing this nonzero value into NZR and the column number into NZC.
e. Assume matrix Mz has already been defined. Place the row numbers of all elements in Mz that are negative into
f. Assume that matrix ms has already been defined. Place the elements on the major diagonal into row vector MSD.
g. Create a 5 × 9 matrix RM that contains random numbers chosen between -50 and +50.
h. Place the smallest value and the location within the matrix RM (created above) into MinRM. You may use more than one MATLAB statement to accomplish this task.
Want to see the full answer?
Check out a sample textbook solutionChapter 15 Solutions
Thinking Like an Engineer: An Active Learning Approach (4th Edition)
- 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_forwardPlease write a matlab code to Solve thisarrow_forwardQuestion: For The Given 4-DOF Robot: A. Assign Appropriate Frames For The Denavit-... For the given 4-DOF robot: a. Assign appropriate frames for the Denavit-Hartenberg representation. b. Fill out the parameters table. c. Write an equation in terms of A matrices that shows how UTH can be calculated. U # d. a a A1 0-1 A2 1-2 Аз 2 -3 A4 3- Harrow_forward
- Fill in each of the following blanks with the appropriate word: If the displacement model used in the derivation of the element stiffess matrices is also used to derive the element mass matrices, the resulting mass matrix is called __ mass matrix.arrow_forwardplease write a matlab codearrow_forwardHelp me with this ENGINEERING GRAPHICS problem.arrow_forward
- Question 2 and 3 pleasearrow_forwardQ4: Create a Visual Basic Project to find the value of the following series: h? h4 h3 cos(h) = h – 2! 3! 4! Write the code program so that the value of angle (h) is entered into inputbox. Estimate the value of series (cos(h)) so that the absolute value of any term is greater or equal to 10-6. Display the required number of terms (N) which it used in this series in a text box and display the result of series (cos(h)) in another separate text box.arrow_forwardSolve all parts !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