%% Retrieve Data and Context from Instrument Variable
% Retrieve the instrument set ExampleInst from the data file InstSetExamples.mat. ExampleInst contains three types of instruments: Option, Futures, and TBill.

load InstSetExamples; 
instdisp(ExampleInst)

% Get the prices and contracts from all instruments.

FieldList = {'Price'; 'Contracts'} 
DataList = instgetcell(ExampleInst, 'FieldName', FieldList ) 
P = DataList{1} 
C = DataList{2}

% Get all the option data: Strike, Price, Opt, Contracts.

[DataList, FieldList, ClassList] = instgetcell(ExampleInst,'Type','Option')

% Look at the data as a comma-separated list.

DataList{:}

% Copyright 2020 The MathWorks, Inc.