MATLAB: Trading Toolbox – Retrieve Option Chain from Interactive Brokers

interactive brokersoptionsTrading Toolbox

I'm trying to use the Interactive Brokers functionality below to return an option chain including all strike prices and expires for a given security. Is this possible to do this with Matlab's Trading Toolbox? I can't seem to make it work in Matlab R2017a. Thanks.
https://interactivebrokers.github.io/tws-api/options.html#option_chains

Best Answer

Turns out this is very easy to do with Yahoo Finance...
function d = getchain(ticker)
% DESCRIPTION: This function retrieves all stikes prices and expiry dates
% from yahoo finance for a given ticker input.
%
% REFERENCES
% https://www.mathworks.com/matlabcentral/fileexchange/50455-getyahoooptionchain
% https://stackoverflow.com/questions/38680008/how-can-i-download-option-tables-using-the-yahoo-finance-api/40243903#40243903
data = webread(['https://query1.finance.yahoo.com/v7/finance/options/' ticker]);
expys = datetime(data.optionChain.result.expirationDates,'ConvertFrom','posixtime','Format','MM-dd-yyy')
strks = data.optionChain.result.strikes
end