plot time versus temperature
이전 댓글 표시
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
2013년 9월 6일
Post a sample of the data you want to plot
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
2013년 9월 6일
plot(timestr, temp);
datetick('x', 'HH:MM:SS')
댓글 수: 2
Kaushal Mishra
2013년 9월 7일
Walter Roberson
2013년 9월 7일
In the excel file, what format is the time in? Please give a couple of lines of sample input.
카테고리
도움말 센터 및 File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!