Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need help with fixing this code. Everytime i run the code an error comes up for step 2 . Step one has the imported
I need help with fixing this code. Everytime i run the code an error comes up for step Step one has the imported datas that i need and its supposed to generate a two graphs. The two graphs that i need are shown in the
picture.
Step : Import the two datasets and combine them into one global datasetdata importdataCarsAggregated.csv; Dataset is stored in 'download file'data importdataVansAggregated.csv; The second dataset is stored in 'download file' Combine the datasetscombineddata data; data; Step : Bar chart showing how many cars use distinct fuel typesfueltypes uniquecombineddata:;fueltypecounts histcountscombineddata: fueltypes;figure;barfueltypes, fueltypecounts;titleNumber of Cars by Fuel Type';xlabelFuel Type';ylabelNumber of Cars'; Step : Create a scatter plot showing the weighted CO Percentage for each carsortedcombineddata sortrowscombineddata, ; Sort by car manufacturerweightedCOpercentage sortedcombineddata: end; Weighted CO percentage is in the last column Plot scatter plotfigure;scatter:numelweightedCOpercentage weightedCOpercentage;hold on; Fit a polynomial of degree p polyfit:numelweightedCOpercentage weightedCOpercentage, ;xvalues :numelweightedCOpercentage;yfit polyvalp xvalues;plotxvalues, yfit, r 'LineWidth', ;titleWeighted CO Percentage for Each Car';xlabelCar Sorted by Manufacturer;ylabelWeighted CO Percentage';legendData Points', 'Line of Best Fit Degree 'Location', 'best';hold off;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started