Menu

[Solved]Lab Assignment 6 Csci 251 Lab 6 Use Xy Scatterplot Graph Cholesterol Data File Cholesterol Q37223891

Lab Assignment 6 CSCI 251 For Lab 6, you will use an xy-scatterplot to graph cholesterol data from the file Cholesterol.csv (You should run the file and in MATLABs workspace window, and click on numVal to verify the above data You will need to provig green r red c cyan m magenta y yellow k black w white Now, choose the line style for HDL Cholesterol - solid : dotted . dasclear clc clf oneLine ; numVal ; %Open comma-separated file fh- fopen ( Cholesterol.csv., r); %Read in one ïine at a time

Lab Assignment 6 CSCI 251 For Lab 6, you will use an xy-scatterplot to graph cholesterol data from the file Cholesterol.csv (comma delimited file) as follows: Cholesterol Fall 2018 220 LDL Cholesterol VLDL Cholesterol HDL Cholesterol 200 180 160 140 120 100 80 60 20 2012 2007 2008 2009 2010 2011 2013 2014 You will not create a new file but instead download and edit graphChol.m to include the above plot, including marker styles. Code has already been provided that reads the data from Cholesterol.csv and populates the numVal array: numVal array 20132014 126 120 30 33 2006 95 30 42 149 2007 2008 2009 95 42 39 209 2010 2011 114 29 39 147 2012 109 95 120 35 43 43 164 36 167 40 110 176 151 166 You should run the file and in MATLAB’s workspace window, and click on numVal to verify the above data You will need to provide code using MATLAB’s plotting commands as stated in graphChol.m, approximately lines 18-26 and lines 31-41 As shown in the figure, the four lines should be formatted as follows: As shown in the figure, the four lines should all be solid lines formatted as follows: Marker Style circle square diamond Data LDL Cholesterol VLDL Cholesterol HDL Cholesterol ntagram For each data line, prompt the user for the line color as well as the line style. If you type help plot at the Command Window, all possible line styles are listed. Recall that when specifying the line color/marker style/line style attribute, you can concatenate using square brackets [] within the plot command Additionally, you must fill in the Marker face color with the same color as the line There must be a title, and the legend should appear in the upper-right corner Note: you have been provided with data that assigns values to the x-axis labels (2006 to 2014). If you look at the code that defines the ticker label on lines 28 and 29, this should clue you in how to plot the y portion in the xy scatterplot. Your electronic submission of the program file will represent your endorsement of the Honor Code Statement. % CSCI 251, Section X % Jane Doe % Student ID 12345678 % Lab Assignment 6 % Due % in keeping with the Honor Code of the University of Mississippi, % I have neither given nor received assistance from anyone other % than the instructor Comments have already been added We were unable to transcribe this imageg green r red c cyan m magenta y yellow k black w white Now, choose the line style for HDL Cholesterol – solid : dotted . dashdot – dashed space] for no line For Tryglycerides choose one of the following line colors: g green r red c cyan m magenta y yellow k black w white Now, choose the line style for Tryglycerides: – solid : dotted -. dashdot – dashed space] for no line <spacebar was entered here> clear clc clf oneLine ; numVal ; %Open comma-separated file fh- fopen ( ‘Cholesterol.csv., “r”); %Read in one ïine at a time and build the numvaï array while ~feof (fh) oneLine – fgetl(fh); token textscan (oneLine, ‘sd’, ‘delimiter’, “,’); numVal = [numVal token{1}]; end %Define length of x – look at the data file (how many points on each line) %Add title Prompt for the four line colors and styles gggggg. 응 응 응용 fly 응 용 응 응 응 gg g g g gg g g gggggggggggg set(gca, ‘XTick’,1:length (numVal)); set(gca, ‘XTickLabel’, numVal (1,: )); 960n SAME graph, plot Triglycerides, HDL Cholesterol, %VLDL Cholesterol, and LDL Cholesterol sUse both the line color and style as entered by user), %Use marker style according to lab instructions %Marker face colors must be filled in and the same as the line color %Add a legend in upperright corner Show transcribed image text Lab Assignment 6 CSCI 251 For Lab 6, you will use an xy-scatterplot to graph cholesterol data from the file Cholesterol.csv (comma delimited file) as follows: Cholesterol Fall 2018 220 LDL Cholesterol VLDL Cholesterol HDL Cholesterol 200 180 160 140 120 100 80 60 20 2012 2007 2008 2009 2010 2011 2013 2014 You will not create a new file but instead download and edit graphChol.m to include the above plot, including marker styles. Code has already been provided that reads the data from Cholesterol.csv and populates the numVal array: numVal array 20132014 126 120 30 33 2006 95 30 42 149 2007 2008 2009 95 42 39 209 2010 2011 114 29 39 147 2012 109 95 120 35 43 43 164 36 167 40 110 176 151 166
You should run the file and in MATLAB’s workspace window, and click on numVal to verify the above data You will need to provide code using MATLAB’s plotting commands as stated in graphChol.m, approximately lines 18-26 and lines 31-41 As shown in the figure, the four lines should be formatted as follows: As shown in the figure, the four lines should all be solid lines formatted as follows: Marker Style circle square diamond Data LDL Cholesterol VLDL Cholesterol HDL Cholesterol ntagram For each data line, prompt the user for the line color as well as the line style. If you type help plot at the Command Window, all possible line styles are listed. Recall that when specifying the line color/marker style/line style attribute, you can concatenate using square brackets [] within the plot command Additionally, you must fill in the Marker face color with the same color as the line There must be a title, and the legend should appear in the upper-right corner Note: you have been provided with data that assigns values to the x-axis labels (2006 to 2014). If you look at the code that defines the ticker label on lines 28 and 29, this should clue you in how to plot the y portion in the xy scatterplot. Your electronic submission of the program file will represent your endorsement of the Honor Code Statement. % CSCI 251, Section X % Jane Doe % Student ID 12345678 % Lab Assignment 6 % Due % in keeping with the Honor Code of the University of Mississippi, % I have neither given nor received assistance from anyone other % than the instructor Comments have already been added

g green r red c cyan m magenta y yellow k black w white Now, choose the line style for HDL Cholesterol – solid : dotted . dashdot – dashed space] for no line For Tryglycerides choose one of the following line colors: g green r red c cyan m magenta y yellow k black w white Now, choose the line style for Tryglycerides: – solid : dotted -. dashdot – dashed space] for no line
clear clc clf oneLine ; numVal ; %Open comma-separated file fh- fopen ( ‘Cholesterol.csv., “r”); %Read in one ïine at a time and build the numvaï array while ~feof (fh) oneLine – fgetl(fh); token textscan (oneLine, ‘sd’, ‘delimiter’, “,’); numVal = [numVal token{1}]; end %Define length of x – look at the data file (how many points on each line) %Add title Prompt for the four line colors and styles gggggg. 응 응 응용 fly 응 용 응 응 응 gg g g g gg g g gggggggggggg set(gca, ‘XTick’,1:length (numVal)); set(gca, ‘XTickLabel’, numVal (1,: )); 960n SAME graph, plot Triglycerides, HDL Cholesterol, %VLDL Cholesterol, and LDL Cholesterol sUse both the line color and style as entered by user), %Use marker style according to lab instructions %Marker face colors must be filled in and the same as the line color %Add a legend in upperright corner

Expert Answer


Answer to Lab Assignment 6 CSCI 251 For Lab 6, you will use an xy-scatterplot to graph cholesterol data from the file Cholesterol…. . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *