Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

for the y axis could you make it go up by 0 , 1 0 , 2 0 , 3 0 , 4 0 ,

for the y axis could you make it go up by 0,10,20,30,40,50, and could you make the blue and orange circles a bit more spread out around the graph. When i use this code i keep getting the graph that you see in the picture , everything is fine i just nees the y axis to go up by 10s starting at 0 and ending at 50. And i need the blue and orange circles to be more spread out. Just fix those two things do not change anything else.
Here is the code to use on matlab :
% Set a fixed seed for reproducibilityseed =50; % Choose any integer value for the seedrng(seed); % Set the random number generator seed% Sample data for Diesel and Petrol carscarPosition = linspace(1,60,50);% Assumed CO2 emissions for Diesel and PetrolCO2Diesel =20+2* exp(-carPosition /60*2* pi)- randn(1,50)*2;CO2Petrol =18+2*(carPosition /60*2* pi).^0.3+ randn(1,50)*2;% Fit polynomial curves with a reduced degree of 2pDiesel = polyfit(carPosition, CO2Diesel, 2);pPetrol = polyfit(carPosition, CO2Petrol, 2);% Generate points for best fit linesfitDiesel = polyval(pDiesel, carPosition(carPosition50));fitPetrol = polyval(pPetrol, carPosition);% Plotting the datafigure;hold on;% Plot Diesel best fit lineplot(carPosition(carPosition50), fitDiesel, 'Color', [1,0.5,0], 'LineWidth', 2);% Plot Petrol best fit lineplot(carPosition, fitPetrol, 'Color', [0.5,0,0.5], 'LineWidth', 1);% Petrol datascatter(carPosition, CO2Petrol, 'o', 'MarkerEdgeColor', [0,0.5,1]); % Blue for Petrol% Diesel datascatter(carPosition, CO2Diesel, 'o', 'MarkerEdgeColor', [1,0.5,0]); % Orange for Diesel% Customize the plotxlabel('Car Position');ylabel('CO2 Weighted Percentage');title('Weighted CO2 Emissions');xlim([160]);ylim([050]);% Add a legend with custom nameslegend('Diesel Best Fit', 'Petrol Best Fit', 'Petrol', 'Diesel');% Add grid linesgrid on;hold off;
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional SQL Server 2000 Database Design

Authors: Louis Davidson

1st Edition

1861004761, 978-1861004765

More Books

Students also viewed these Databases questions

Question

2. Outline the business case for a diverse workforce.

Answered: 1 week ago