csv2plot - %reads in the comma-separated file and stores...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
function csv2plot(fn) %Given a comma-seperated file containing an Mx4 array of doubles, write %a function csv2plot that will graph two curves on the same plot. The %Mx4 array (not the file, the array) will look something similar to %this: % % x1 y1 x2 y2 % ------------------ % 5 29 12 18 % 2 18 4 -3 % 14 6 1 2 % 9 0 8 10 % %So first two columns are for curve 1 and last two columns are for curve %2. Plot the first curve in magenta and the second curve in black. Use a %line (the default) for the first plot. Use circles to mark each point %from the second set of data (do not connect them with a line). data = csvread(fn);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: %reads in the comma-separated file and stores the numeric data [r c] = size(data); %finds the number of rows and columns of the data plot(data(:,1),data(:,2),'m',data(:,3),data(:,4),'ko'); %creates a 2D plot with the specified data indexed, and then makes the %color magenta with a regular lines connecting the data; creates a 2D plot %with the specified data indexed, and then makes the color black with the %coordinates replaced with an o xlabel('x-axis'); %labels the x-axis ylabel('y-axis'); %labels the y-axis title('Graph for csv2plot'); %gives the graph a title end...
View Full Document

This note was uploaded on 10/21/2010 for the course CS 1371 taught by Professor Stallworth during the Spring '08 term at Georgia Tech.

Ask a homework question - tutors are online