matlab error: Function 'subsindex' is not defined for values of class 'containers.Map'
<p>I am trying to write a script that counts the maximum number of consecutive rounds a genome is alive in a pool. I do this using the following code:</p>

<pre><code>dd = dir('*.csv');

fileNames = {dd.name}; 

data = cell(numel(fileNames),2);
data(:,1) = regexprep(fileNames, '.csv','');

for i = 1:numel(fileNames)    
   data{i,2} = dlmread(fileNames{i});
end

cc = distinguishable_colors(numel(fileNames));                % get better colormap

livedlong = containers.Map;                                   % contains all the streaks

for k = 1:numel(fileNames)

    strat = data{k,1}(10:end); % get strategy name
    XY = data{k,2};            % get data
    X = XY(:,1);               % get rounds
    Y = XY(:,2);               % get #tiles
    streak = 1;                % set streak counter to 1
    longestStreak = streak;    % set longestStreak to 1        


    %%% Calculate the streaks!
    for l = 1:(numel(X)-1)
        if ((X(l)+1) == X(l+1))
            streak = streak + 1;
            if (streak &gt; longestStreak)
                longestStreak = streak;
            end
        else
            streak = 1;
        end
    end

    livedlong(strat)=longestStreak;              % save the streaks

end

k = keys(livedlong);
v = values(livedlong);
for i = 1:length(livedlong)
    plot(k{i}, v{i}, 'o', 'color', cc(i,:))
end
</code></pre>

<p>However, the last 5 rows (or rather calling: <code>keys(livedlong)</code> or <code>values(livedlong)</code>) yields the following error: <code>Function 'subsindex' is not defined for values of class 'containers.Map'.</code> and I have no idea why. I was able to use the commands on the Map in the command window a while ago, but now I cannot do that either.</p>