Concept explainers
A matrix names mach contains three columns of data concerning the energy output of several machines. The first column contains an ID code for a specific machine, the second column contains the total amount of energy produced by that machine in calories, and the third column contains the amount of time required by that machine to produce the energy listed in column 2 in hours. Write a function name MPower to accept as input the matrix mach and return a new matrix named P containing two columns and the same number of rows as mach. The first column should contain the machine ID codes, and the second column should contain the average power generated by each machine in units of watts. You must use a loop to accomplish this. Do not use direct matrix operations.
Want to see the full answer?
Check out a sample textbook solutionChapter 20 Solutions
Thinking Like an Engineer: An Active Learning Approach (3rd Edition)
- .arrow_forwardHi I need help to make the line change into a different color, I half of the line to be orange and I need the other half of the line towards the end to be purple as shown in the picture. Also I need there be a box saying Diesel, petrol, diesel best fit, petrol best fit. This part is also shown in the graph. Please use this code and fix it in MATLAB: % Sample data for Diesel and Petrol cars carPosition = linspace(1, 60, 50); % Assumed positions of cars % Fix the random seed for reproducibility rng(50); % Assumed positions of cars CO2Diesel = 25 + 5*cos(carPosition/60*2*pi) + randn(1, 50)*5; % Random data for Diesel CO2Petrol = 20 + 5*sin(carPosition/60*2*pi) + randn(1, 50)*5; % Random data for Petrol % Fit polynomial curves pDiesel = polyfit(carPosition, CO2Diesel, 3); pPetrol = polyfit(carPosition, CO2Petrol, 3); % Generate points for best fit lines fitDiesel = polyval(pDiesel, carPosition); fitPetrol = polyval(pPetrol, carPosition); % Combine the best fit lines combinedFit =…arrow_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_forwardCould you please fix my code it’s supposed to look like the graph that’s on the picture. But the lines do not cross eachother at the beginning. Could you make the lines look like the lines on the graph? Use this code in MATLAB and fix it. % Sample data for Diesel and Petrol cars carPosition = linspace(1, 60, 50); % Assumed positions of cars % Define your seed here seed = 50; rand('seed',seed); % Set the seed for reproducibility % Assumed CO2 emissions for Diesel and Petrol CO2Diesel = 25 + 5*cos(carPosition/60*2*pi) + randn(1, 50)*5; % Random data for Diesel CO2Petrol = 20 + 5*sin(carPosition/60*2*pi) + randn(1, 50)*5; % Random data for Petrol % Fit polynomial curves with a reduced degree of 2 pDiesel = polyfit(carPosition, CO2Diesel, 2); pPetrol = polyfit(carPosition, CO2Petrol, 2); % Generate points for best fit lines fitDiesel = polyval(pDiesel, carPosition); fitPetrol = polyval(pPetrol, carPosition); % Plotting the data figure; hold on; % Plot Diesel best fit line…arrow_forwardFor Questions 3 and 4: A cup of water was heated to a temperature of 90°. It was placed in a refrigerator that had a temperature of 11°C. The water cooled to a temperature of 17°C in 30 minutes. Let the following variables represent the relevant quantities. L = Temperature of the liquid S= Temperature of the surroundings t = Time B = Initial temperature of the liquid (Temperature at t = 0 k = Cooling constant 3. Using the Equation Solver, find the value of k in the equation L = (B - S)e -kt + S. Remember to set the equation equal to zero and then enter it into the Solver.arrow_forward
- I need help with the purple line the line that you see one the graph on the picture needs to be on the graph. Use this code to add the purple line and make sure it’s crossing the orange line. Please make sure the lines are positioned the same way it is shown on the picture with the graph. Use this code on MATLAB and add the purple line. % Sample data for Diesel and Petrol cars carPosition = linspace(1, 60, 50); % Assumed positions of cars % Use the 'seed' function instead of 'rng' seed = 50; % Define your seed here rand('seed',seed); % Assumed CO2 emissions for Diesel and Petrol CO2Diesel = 25 + 5*cos(carPosition/60*2*pi) + randn(1, 50)*5; % Random data for Diesel CO2Petrol = 20 + 5*sin(carPosition/60*2*pi) + randn(1, 50)*5; % Random data for Petrol % Fit polynomial curves with a reduced degree of 2 pDiesel = polyfit(carPosition, CO2Diesel, 2); pPetrol = polyfit(carPosition, CO2Petrol, 2); % Generate points for best fit lines fitDiesel = polyval(pDiesel, carPosition);…arrow_forwardHello I’m trying to make the graph that you see in the picture, I’m trying the exact copy of that graph using this code but I’m having a hard time doing that. Could you change the code so that it looks like the graph that you see on the picture using MATLAB, please send the code when you are finished. % Sample data for Diesel and Petrol cars carPosition = linspace(1, 60, 50); % Assumed positions of cars % Fix the random seed for reproducibility rng(45); % Assumed positions of cars CO2Diesel = 25 + 5*cos(carPosition/60*2*pi) + randn(1, 50)*5; % Random data for Diesel CO2Petrol = 20 + 5*sin(carPosition/60*2*pi) + randn(1, 50)*5; % Random data for Petrol % Fit polynomial curves pDiesel = polyfit(carPosition, CO2Diesel, 3); pPetrol = polyfit(carPosition, CO2Petrol, 3); % Generate points for best fit lines fitDiesel = polyval(pDiesel, carPosition); fitPetrol = polyval(pPetrol, carPosition); % Plotting the data figure; hold on; scatter(carPosition, CO2Diesel, 'o', 'MarkerEdgeColor', [1 0.5…arrow_forward4:16 Search Expert Q&A Done Please solve question 16-109 below this in the follwoing way: • Please include a kinamatic diagram (one for velocity and one for acceleration). • Please DO NOT solve this using velocity analysis (cartesian vector analysis). I would like it to be solved using scalar method. We dont use 3D in this course. We only use scalar analysis for the relative velocity equation (writing the x and y components of the equation and solving the equations for the unknowns). I have attached a sample question with solution in order to get an idea on how to use the scalar method to solve my question. I would like question 16-109 to be solved in a similar way. Thank you for your understanding. If you can solve it as soon as possible that would be great and I will give you a thumps up and positive feedback :) 16-109. Member AB has the angular motions shown. Determine the angular velocity and angular acceleration of members CB and DC. 100 mm D 60° 450 mm W AB α AB 84 = 2 rad/s = 4…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