On 05/10/2017 04:44 PM, Przemek
Klosowski wrote:
One conceptual problem I have is that it returns the data as
an array of structs (one per row); e.g. for my simple temperature
data,
a(1:2).time,a(1:2).tempc
ans = 2016-04-08 17:30
ans = 2016-04-08 17:45
ans = 35
ans = 36
What's the easiest way to return the entire column of data, i.e.
collate a given struct field from every array member into a
vector?
Never mind, it's of course a comma-separated list so the
following works:
a=sqlite3("temp.db",'select julianday(time)as d,tempc as t from
t')
plot([a.d],[a.t])
One word of caution: I had to rename the columns because the code
silently fails for fancy SQL expressions such as julianday(time),
probably because it's an invalid struct field name.