0001 function [effective_vary_indices, linked_inds] = dsCheckCovaryWrapper(data,varargin)
0002
0003
0004
0005
0006
0007
0008
0009
0010 labels = data(1).labels;
0011 inds = arrayfun(@(s) ~isempty(s.(labels{1})),data);
0012 data = data(inds);
0013
0014
0015
0016 vary_labels = data(1).varied;
0017 no_vary_labels = length(vary_labels);
0018 vary_params = cell(length(data), no_vary_labels);
0019 vary_vectors = cell(no_vary_labels, 1);
0020 vary_lengths = nan(no_vary_labels, 1);
0021
0022
0023
0024 for v = 1:no_vary_labels
0025 for i = 1:length(data)
0026 vary_params{i, v} = data(i).(vary_labels{v});
0027 end
0028 end
0029
0030
0031 if iscellnum(vary_params);
0032
0033 vary_params = cell2mat(vary_params);
0034 elseif iscell(vary_params) && ~iscellstr(vary_params)
0035
0036
0037
0038
0039 for j = 1:numel(vary_params)
0040 if isnumeric(vary_params{j})
0041 vary_params{j} = num2str(vary_params{j});
0042 end
0043 end
0044 end
0045
0046 for v = 1:no_vary_labels
0047 vary_vectors{v} = unique(vary_params(:, v));
0048 vary_lengths(v) = length(vary_vectors{v});
0049 end
0050
0051
0052 [effective_vary_indices, linked_inds] = dsCheckCovary(vary_lengths, vary_params, varargin{:});
0053
0054 end