Assume four row
Write a single line of code to answer each of the following questions. You may use the results of any question to answer subsequent questions if desired. Note that your solutions should work regardless of the number of elements in the four vectors.
- a. Create a new vector AvgProd that contains the total number of each item produced during the four-year period. Note that TotalProd will have the same number of elements as the original four vectors.
- b. Create a new vector AvgProd that contains the average number produced per year of each item during the four-year period. Note that AvgProd will have the same number of elements as the original four vectors.
- c. Create a four-element column vector YearProd that contains the total number of all units produced during each year, 2010 production should be in the first (top) element.
- d. Determine the maximum number of any type of device produced during each year and place the results in a four-element column vector MaxProd.
- e. Determine the maximum number of any device produced during any year and place the result in the scalar OverallMax.
- f. If your company makes a profit of one-fifth of one cent on each device produced, regardless of type, determine the total profit made during this four-year period and place the result in Profit. Your result should be in dollars.
Want to see the full answer?
Check out a sample textbook solutionChapter 15 Solutions
Thinking Like an Engineer: An Active Learning Approach (4th Edition)
- Required information A model of a person's arm is used for ergonomics studies. Distances are rAB = 30 cm, rBC = 28 cm, and rcpD = 19 cm. NOTE: This is a multi-part question. Once an answer is submitted, you will be unable to return to this part. y 30 Express TAD using polar vector representation, measuring orientation positive counterclockwise from the right-hand horizontal direction. The polar representation of the resultant vector is TAD cm @ -arrow_forwardPART A Using the graph to the right, what would Air Pressure be (mb) at an altitude of 10 km? What is the approximate altitude where the air pressure is 400 mb? PART B At an altitude of 0 km, what is the air pressure in mb?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_forward
- I need help coding in MATLAB. I have a .txt file containing the following data. That data is saved in a file named data.txt. I am wondering how I could extract all or some of that data into another .m file. Can you show me the code. [[5.0018696581196584, 17.863820207570207, -13.086858974358975], [5.0018696581196584, 17.863820207570207, -13.086858974358975], [5.0018696581196584, 17.863820207570207, -13.086858974358975]]arrow_forwardsample calculations 目 File Edit View Insert Format Data To 100% $ % .0 .00 12: fx | A 1 Variable Value Units diameter height m 4 volume m^3 3 The image above shows a section of a Google sheet. What formula should be written in cell B4 to calculate the volume of a cylinder with a diameter value in B2 and height in B3? a) =0.25*PI()*B2^2 * B3 b) =PI()*B2^2 * B3 c) =pi*diameter^2 * height d) =PI*B2^2 * B3 3 5arrow_forwardMy professor said that I need to use the numbers as shown on the picture and make the exact graph that is also shown on the picture. But I don’t know how to put this in to MATLAB. Please send the code that makes the graph that is shown in the picture. Make it 100% exactly the same.arrow_forward
- convert height to cm File Edit View Insert Format Data Tools 100% % .0 .00 123 D20 fx | A 1 5 feet 2 11 inches 3 cm 4 The preceding image shows a Google Sheet used to convert length in feet and inches to cm. What formula should be entered into A3 so that the correct length is computed in cm (in cell A3)? Your answer must work with any values the user might enter in cells A1 and A2. Choose all that apply a) = A1*12*2.54 + A2*2.54 b) = (5*12 + 11) * 2.54 %3D c) = B1*12*2.54 + B2*2.54 d) A1*12*2.54 + A2*2.54 e) = (A1*12 + A2) * 2.54 f) = A1*12 + A2 * 2.54 %24 田arrow_forwardDon't Use Chat GPT Will Upvote And Give Handwritten Solution Pleasearrow_forwardYour choices from the drop down menu are "1, 2.5, and 3.5" Please see both images for reference. Thanks!arrow_forward
- Grindwell, Inc., a manufacturer of grinding tools, is concerned about the durability of its products, which depends on the permeability of the sinter mixtures used in production. Suspecting that the carbon content might be the source of the problem, the plant manager collected the accompanying data. Click the icon to view the data table. a. Based on the data, choose the correct graph below. Question #2 O A. ОВ. C. D. 40- 6- 40- 20- 20 40 Carbon Content (%) 20 6. 40 Carbon Content (%) Permeability Index Permeability Index Permeability Index Permeability Index Carbon Content (%) Carbon Content (%)arrow_forwardCould you change the lines in to two lines just like it shows in the graph . Make it exactly those two lines. Keep the colors and the same. Use this code on 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); % Combined best fit combinedFit = (fitDiesel + fitPetrol) / 2; % Plotting the data figure; hold on; % Define the split index and shorten…arrow_forwardEngr 215 Matlab Fahrenheit to Celsius using multiple statements Given a Fahrenheit value temperatureFahrenheit, write a statement that assigns temperatureCelsius with the equivalent Celsius value. While the equation is C = 5/9 * (F - 32), as an exercise use two statements, the first of which is "fractionalMultiplier = 5/9;"]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