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)
- Help me solve this using MATLABarrow_forward.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_forward
- Question: 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_forwardFill 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_forward
- For 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_forwardI 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_forwardFor the Following question Graph all 4 : [I just need all 4 graphs and please explain and make clean solution] Position vs time Velocity vs time Acceleration vs time Force vs time [For your convenience, I have solved the numerical solutions for the problem] (Please Look at the picture since it is much cleaner) Question : A 550 kilogram mass initially at rest acted upon by a force of F(t) = 50et Newtons. What are the acceleration, speed, and displacement of the mass at t = 4 second ? a =(50 e^t)/(550 ) [N/kg] v = ∫_0^t▒(50 e^t )dt/(550 )= v_0 +(50 e^t-50)/550=((e^t- 1))/11 x = ∫_0^t▒(e^t- 1)dt/(11 )= x_0 +(e^t- t - 1)/(11 ) a(4s)=(50*54.6)/550= 4.96[m/s^2 ] v(4s)=((e^4-1))/11= 4.87[m/s] x(4s)=((e^4- 4 - 1))/11= 4.51 [m]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