[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Beginners Question - diagram date / values
From: |
Martin Wagner |
Subject: |
Beginners Question - diagram date / values |
Date: |
Sun, 04 Mar 2018 15:35:45 +0100 |
Hi @all,
I'm trying to create a simple time / values X-Y diagram. However, I'm
having a weird resolution problem on the X axis.
For some reason, multiple y values are assinged to one sinlge X time
value (see https://ibb.co/eZJYxn).
This is the same data in libre office: https://ibb.co/iLYcOS .
When I check the time values, all of them are the same values.
Any ideas what I'm doing wrong?
Thanks for your help!
This is the csv source data:
Time,Temperature
27.02.2018 17:10:56,19.99
27.02.2018 17:11:57,19.91
27.02.2018 17:12:58,20.01
27.02.2018 17:13:59,19.98
27.02.2018 17:15:00,20.15
27.02.2018 17:16:01,20.20
27.02.2018 17:17:02,20.14
... many more days
and this is the code I tried:
fd = fopen('file.csv')
a = textscan(fd, '%s %f', 'Delimiter', ',', 'HeaderLines', 1)
a
a =
{
[1,1] =
{
[1,1] = 27.02.2018 17:10:56
[2,1] = 27.02.2018 17:11:57
[3,1] = 27.02.2018 17:12:58
[4,1] = 27.02.2018 17:13:59
[5,1] = 27.02.2018 17:15:00
[6,1] = 27.02.2018 17:16:01
[7,1] = 27.02.2018 17:17:02
}
[1,2] =
19.990
19.910
20.010
19.980
20.150
20.200
20.140
}
a{1} = datenum(a{1},'dd.mm.yyyy HH:MM:SS');
a
a =
{
[1,1] =
7.3712e+05
7.3712e+05
7.3712e+05
7.3712e+05
7.3712e+05
7.3712e+05
7.3712e+05
[1,2] =
19.990
19.910
20.010
19.980
20.150
20.200
20.140
}
plot(a{1},a{2})
- Beginners Question - diagram date / values,
Martin Wagner <=