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)
- matlab pleasearrow_forwardUSE MATLAB AND SOLVE THIS QUESTION The ideal gas law relates the pressure P, volume V, absolute temperature T, and amount of gas n. The law is P = nRT/ V where R is the gas constant. An engineer must design a large natural gas storage tank to be expandable to maintain the pressure constant at 2.2 atm. In December when the temperature is 4°F (- 15°C), the volume of gas in the tank is 28 500 ft3 . What will the volume of the same quantity of gas be in July when the temperature is 88°F (31°C)? (Hint: Use the fact that n, R, and P are constant in this problem. Note also that K =°C +273.2.)arrow_forwardPlease help, this for Matlab the image is the first question with following 2 and 3 they go together. 2. Solving the question by using bisection.m with the stopping criterion at 1%. Report the root and # of iterations. 3. by using newton-Raphson matlab script with the stopping criterion at 0.1%. Report the root and # of iterations.arrow_forward
- MATLAB coding requiredarrow_forwardMatlab code pleasearrow_forwardHelp with the MATLAB code to do the following: Given an audio recording of vehicles, compute Power Spectral Density, 1/3 octave band level, octave band level, A-weighted Leq, C-weighted Leq, L10 (unweighted since sample is short), L90 (unweighted since sample is short). If the measurement is made at approximately 50 ft, and that the vehicles are moving at an average of 65 mph, what is the flow rate Q? If instead, the noise is dominated by 1-2 motorcycles, how fast are they going? Given- -The data are in counts -Calibration factor is 133 uPa/count -Sample rate is 44100Hz. -Remember that in air the dB reference is 20 uPa -Pwelch requires that the inputs are doublesarrow_forward
- USE MATLAB (Convolutional Code) The vector representation of a convolutional code is g1=[1 1]and g2=[1 0]. If the received sequence is 11 11 01 10, please use Viterbi Algorithm todecode it. Please show the full trellis diagram, including the updated trellis statemetrics.arrow_forwardAs4. This is my third time asking this question. Please DO NOT copy and paste someone else's work or some random notes. I need an answer to this question. There is a mass attached to a spring which is fixed against a wall. The spring is compressed and then released. Friction and is neglected. The velocity and displacement of the mass need to be modeled with an equation or set of equations so that various masses and spring constants can be input into Matlab and their motion can be observed. Motion after being released is only important, the spring being compressed is not important. This could be solved with dynamics, Matlab, there are multiple approaches.arrow_forwardThe natural exponential function can be expressed by . Determine e2by calculating the sum of the series for:(a) n = 5, (b) n = 15, (c) n = 25For each part create a vector n in which the first element is 0, the incrementis 1, and the last term is 5, 15, or 25. Then use element-by-element calculations to create a vector in which the elements are . Finally, use the MATLAB built-in function sum to add the terms of the series. Compare thevalues obtained in parts (a), (b), and (c) with the value of e2calculated byMATLAB.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