plot time versus temperature

10 ビュー (過去 30 日間)
Kaushal Mishra
Kaushal Mishra 2013 年 9 月 6 日
I have excel file with time and temperature listing.
time temp
13:51:42 30
13:51:44 31
13:51:46 32
13:51:48 34
seconds in the gap of 2 seconds till 58 and temperature in gap of 1. i have to plot the graph of time and temp in matlab. Time on the x axis and Temp on y axis. i read the temp and time by xlsread.
filename= 'temp1.xlsx';
temp=xlsread(filename, 'B:B');
time=xlsread(filename,'A:A');
timestr= datestr(time,'HH:MM:SS');
i tried to read the time in HH:MM:SS format. i got output of timestr as val= 13:51:42 , 13:51:44 ans=d so on uptill 13:51:58.It's written in the output as scalar value . The result is not the matrix . I am unable to plot this scalar quantity with the matrix of temp. Now,how to plot these values. "plot" function alone is not working. pls pls help
  2 件のコメント
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 9 月 6 日
Post a sample of the data you want to plot
Image Analyst
Image Analyst 2013 年 9 月 6 日
You forgot to show your plot line, and explain what's not working (error message, or just not what you expect). Post a screenshot to httpL//snag.gy

サインインしてコメントする。

回答 (1 件)

Walter Roberson
Walter Roberson 2013 年 9 月 6 日
plot(timestr, temp);
datetick('x', 'HH:MM:SS')
  2 件のコメント
Kaushal Mishra
Kaushal Mishra 2013 年 9 月 7 日
I tried this earlier but it is not working. Because the timestr result is not a matrix. It shows as "val= 13:51:42 , 13:51:44 uptill 13:51:58".
Walter Roberson
Walter Roberson 2013 年 9 月 7 日
In the excel file, what format is the time in? Please give a couple of lines of sample input.

サインインしてコメントする。

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by