I'm trying to use Yahoo API in MATLAB R2015a to retrieve historical data (prices) for commodities. I can get the price for current date, but not for a historical date range. So for example Last price for CK15.CBT Corn May 15:
clearclcc = yahoo;a = fetch(c,'CK15.CBT','Last');disp (a);d = fetch(c,'CK15.CBT','Last','02/02/15','02/05/15');disp (d);
Displaying "a" works ok, but "d" returns the following error messages:
Error using yahoo/fetch>isdatafield (line 543)Current data field specified but historical data requested.Error in yahoo/fetch (line 74) elseif isdatafield(varargin{1},numinputs)Error in Untitled (line 7)d = fetch(c,'CK15.CBT','Last','02/02/15','02/05/15');
Could you please help me how to work with yahoo API in MATLAB to get commodities prices for specified time range? Or do you have a suggestion for any other way how to do it?
Thank you