Imported Data - How to Change X Axis Data Source

Hi, I've been struggling with this for 8 hours now and have come close, but cannot get what I need. I imported data from excel that I want to plot in a line graph. Everything works fine, but the X axis data is just the record number (what Matlab calls "index", I think). But I want to choose which column is used for the x axis.
After importing the data by "Create vectors from each column using column names”, I used the plot command to plot multiple values against Time on the x axis and this almost works: >>plot(Time,Adata,Time,Bdata,Time,Cdata...) but then I can't get the legend to show the name of each line. Can you help?
Thanks so much! Tom

댓글 수: 2

legend('AData', 'BData', 'CData') ?
Thomas
Thomas 2012년 1월 23일
Ha, that worked! Thank you so much!!!
Tom

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

질문:

2012년 1월 20일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by