I have this code in a file called createTeamDict.m:
function [ team_dict ] = createTeamDict( team_names, team_ids )
%createTeamDict takes in a cell array of team names and a vector of
%corresponding team IDs and returns an appropriate dictionary, mapping team
%names to their IDs
team_dict = containers.Map;
for i = 1 : length(team_names)
team_dict(team_names{i}) = team_ids(i);
end
end
Then in the file that I'm running, I have:
team_names = {'Trinity', 'SLU', 'Harvard', 'Columbia', 'Rochester', 'Yale', 'Upenn'};
team_ids = [11324 11351 11314 11326 11316 11315 11317];
team_dict = createTeamDict(team_names, team_ids);
For some reason, I'm getting this error when I try to run it:
"Error using createTeamDict (line 6) Not enough input arguments."
Any ideas why this might be the case?
Thanks,
createTeamDict.m? Type inlsin your Command Prompt, push ENTER and see if the file is there. If not, you need to figure out where the file is, change your working directory to where that file is, then run the command again.team_dict = containers.Map(team_names, num2cell(team_ids));createTeamDictin your workspace? Try doingclear createTeamDicttoo while you're at it.