%% Store Values That Are Not Uniform
% Create a Map object that contains test results for patients. For any patient, the results might be in either a numeric array or in a file. You can store numeric arrays and file names as values in the same map. To store values that do not have the same data type in the same map, specify 'UniformValues',false.

keySet = {'Li','Jones','Sanchez'};
testLi = [5.8 7.35];
testJones = [27 3.92 6.4 8.21];
testSanchez = 'C:\Tests\Sanchez.dat';

valueSet = {testLi,testJones,testSanchez};
M = containers.Map(keySet,valueSet,'UniformValues',false)

%
% Display the numeric array associated with Li.

M('Li')

%
% Display the file name associated with Sanchez. If the file contains numeric values, you could then call a function to read those values into an array.

M('Sanchez')

% Copyright 2012 The MathWorks, Inc.