-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathSIN_load_results.m
48 lines (41 loc) · 1.02 KB
/
SIN_load_results.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
function [results] = SIN_load_results(filenames, varargin)
%% DESCRIPTION:
%
% This function loads SIN results structures listed in file_names.
%
% INPUT:
%
% filenames: cell array of file names pointing to results structures.
%
% Parameters:
%
% None (yet)
%
% OUTPUT:
%
% results: a cell array, where each element is the results data loaded
% from the corresponding cell of the file_name input
%
% Development:
%
% None (yet)
%
% Christopher W. Bishop
% University of Washington
% 11/14
%% GATHER PARAMETERS
d=varargin2struct(varargin{:});
%% ERROR CHECKING
% Need file names to have the same number
if ~iscell(filenames)
filenames = {filenames};
end %
%% INITIALIZE RETURN VARIABLE
results = cell(numel(filenames),1);
%% LOOP THROUGH AND LOAD
for i=1:numel(filenames)
% Load the results structure
loaded_results = load(filenames{i}, 'results');
% Assign to return variable
results{i} = loaded_results.results;
end % for i=1:numel(filenames)