MATLAB: Do I get the error “Periodicity option XX-XX-XXXX invalid” when calling the “history” function in the Datafeed Toolbox using Bloomberg’s blp

Datafeed Toolbox

Why do I get the error "Periodicity option XX-XX-XXXX invalid" when calling the "history" function in the Datafeed Toolbox using Bloomberg's blp?
See the following code to produce the error:
 
>> c = blp;
>> [d,sec] = history(c,{'Dummy Corp 1';'Dummy Corp 2';'Dummy Corp 3'},'Last_Price','YLD_YTM_ASK','04/05/2017','06/05/2017');

Best Answer

One argument was passed to the "history" function as multiple arguments. Make sure that fund names are in a cell array and that the list of desired fields are in a cell array as not to have extra arguments.
For the given example, the correct command would be:
 
>> [d,sec] = history(c,{'Dummy Corp 1';'Dummy Corp 2';'Dummy Corp 3'},{'Last_Price','YLD_YTM_ASK'},'04/05/2017','06/05/2017');
The documentation has many different pages for the "history" function. Some of these do not list the optional arguments, but others do.
Enter this command in MATLAB or click the following link to see the Bloomberg "history" doc page (which includes the optional arguments):
 
>> web(fullfile(docroot, 'datafeed/blp.history.html'))
<https://www.mathworks.com/help/releases/R2017a/datafeed/blp.history.html>