Hi. I'm trying to plot data inputted from Excel into a simple (x,y) scatter plot.
As an example, data in the Excel file was:
Location Distance (m) Time (seconds)1 5 1201 10 2001 25 3001 30 3502 4 1002 50 2002 70 2502 100 3003 5 753 12 1003 13 2003 40 300
I've already successfully inputted the data into a matrix using:
B = xlsread('filename','sheetname');
I set each column as a variable:
L = B(:,1); D = B(:,2); T = B(:,3);
I'd like to plot (D,T) for each value of L. I know how to do this if I call each cell in L; for example:
for x = D(1:4) for y = T(1:4) scatter(x,y) end end
However, I'd like to set it up so that I can call for the location (ie, for L = 1) and create separate (x,y) plots of each L, as I have quite a bit of data and think this will be faster. Additionally, the L values correspond with a text value (I converted to numbers as the text appeared as NaN). If possible, I'd like to make the title of each graph correspond with the text Location value. Any suggestions for how to approach this are greatly appreciated.
Cheers
Best Answer