50 Weighted CO2 Emmisions 50 Diesel Petrol 10 40 30 CO2 Weighted Percentage 20 8 10 0 о о 800 0 0 о % -10 0 ୦୧ о 10 10 20 30 40 40 50 60 Car Position Diesel Best Fit Petrol Best Fit

Refrigeration and Air Conditioning Technology (MindTap Course List)
8th Edition
ISBN:9781305578296
Author:John Tomczyk, Eugene Silberstein, Bill Whitman, Bill Johnson
Publisher:John Tomczyk, Eugene Silberstein, Bill Whitman, Bill Johnson
Chapter31: Gas Heat
Section: Chapter Questions
Problem 5RQ: The specific gravity of natural gas is A. 0.08. B. 1.00. C. 0.42. D. 0.60.
Question
Hi 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 = (fitDiesel + fitPetrol) / 2; % Plotting the data figure; hold on; % Combined best fit line plot(carPosition, combinedFit, 'Color', 'k', 'LineWidth', 2); % Petrol data scatter(carPosition, CO2Petrol, 'o', 'MarkerEdgeColor', [0 0.5 1]); % Diesel data scatter(carPosition, CO2Diesel, 'o', 'MarkerEdgeColor', [1 0.5 0]); % Customize the plot xlabel('Car Position'); ylabel('CO2 Weighted Percentage'); title('Weighted CO2 Emissions'); legend('Combined Best Fit', 'Petrol', 'Diesel'); grid on; % Adjust axis limits to match the provided image xlim([1 60]); ylim([15 35]); hold off;
50
Weighted CO2 Emmisions
50
Diesel
Petrol
10
40
30
CO2 Weighted Percentage
20
8
10
0
о
о
800
0 0
о
%
-10
0
୦୧
о
10
10
20
30
40
40
50
60
Car Position
Diesel Best Fit
Petrol Best Fit
Transcribed Image Text:50 Weighted CO2 Emmisions 50 Diesel Petrol 10 40 30 CO2 Weighted Percentage 20 8 10 0 о о 800 0 0 о % -10 0 ୦୧ о 10 10 20 30 40 40 50 60 Car Position Diesel Best Fit Petrol Best Fit
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Refrigeration and Air Conditioning Technology (Mi…
Refrigeration and Air Conditioning Technology (Mi…
Mechanical Engineering
ISBN:
9781305578296
Author:
John Tomczyk, Eugene Silberstein, Bill Whitman, Bill Johnson
Publisher:
Cengage Learning