plot time versus temperature

9 Ansichten (letzte 30 Tage)
Kaushal Mishra
Kaushal Mishra am 6 Sep. 2013
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 Kommentare
Azzi Abdelmalek
Azzi Abdelmalek am 6 Sep. 2013
Post a sample of the data you want to plot
Image Analyst
Image Analyst am 6 Sep. 2013
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

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Walter Roberson
Walter Roberson am 6 Sep. 2013
plot(timestr, temp);
datetick('x', 'HH:MM:SS')
  2 Kommentare
Kaushal Mishra
Kaushal Mishra am 7 Sep. 2013
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 am 7 Sep. 2013
In the excel file, what format is the time in? Please give a couple of lines of sample input.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by