I would just get the official times from somewhere like https://sunrise-sunset.org/api using the webread() function rather than attempt to guess them from ambient light data..
But it is possible to retrieve data from a channel for a specific time see https://au.mathworks.com/help/thingspeak/get-channel-field-feed.html particularly the 'start' and 'end' parameters. Hopefully one of the matlab experts who lurk here might be able to help you with the syntax.