Question: The code that you see run a similar graph but it is not exactly that same as the graph that you see on the picture.

The code that you see run a similar graph but it is not exactly that same as the graph that you see on the picture. Could you please run this code on matlab and fix the code so that it runs the same graph you see on the picture. I want the curve of the lines and the color of the lines exactly the same. Also could you make the blue and oragne circles a little bit more spread out just like you see on the picture. Basically just make the same
graph that you see on the picture.
Fix this code on matlab.
% Sample data for Diesel and PetrolcarPosition = linspace(6,40,50);% CO2 emissions for DieselCO2Diesel =25+5*cos(carPosition/60*2*pi)+5*rand(1,50);% CO2 emissions for PetrolCO2Petrol =20+5*sin(carPosition/60*2*pi)+5*rand(1,50);% Fit polynomial curvespDiesel = polyfit(carPosition, CO2Diesel, 3);pPetrol = polyfit(carPosition, CO2Petrol, 3);% Generate points for best fit linesfitDiesel = polyval(pDiesel, carPosition);fitPetrol = polyval(pPetrol, carPosition);% Plotting the datafigure;hold on;scatter(carPosition, CO2Diesel, 'o', 'MarkerEdgeColor', [10.50]); % Diesel datascatter(carPosition, CO2Petrol, 'o', 'MarkerEdgeColor', [00.51]); % Petrol dataplot(carPosition, fitDiesel, 'Color', [10.50], 'LineWidth', 2); % Diesel best fitplot(carPosition, fitPetrol, 'Color', [00.51], 'LineWidth', 2); % Petrol best fit% Customize the plotxlabel('Car Position');ylabel('CO2 Weighted Percentage');title('Weighted CO2 Emissions');legend('Diesel', 'Petrol', 'Diesel Best Fit', 'Petrol Best Fit');grid on;ylim([1540]); % Set y-axis limitshold off;
 The code that you see run a similar graph but it

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!