Skip to content
Snippets Groups Projects
Commit de123689 authored by Andrew King's avatar Andrew King Committed by Nicola Vigano
Browse files

useful function for gtModifyStructure

git-svn-id: https://svn.code.sf.net/p/dct/code/trunk@499 4c865b51-4357-4376-afb4-474e03ccb993
parent f1796b72
No related branches found
No related tags found
No related merge requests found
function sublist = gtSubList(list, varargin)
%
% based on a list created using make_parameters / build_list,
% make a sublist suitable for gtModifyStructure, containing only the
% requested fields.
%
% input, for example: gtSubList(list.acq, 'name', 'dir', energy')
% output: sublist, a 3x2 cell for gtModifyStructure
% preallocate sublist
sublist=cell(length(varargin), 2);
for i=1:length(varargin)
ndx=find(strcmp(list(:,1), varargin{i}));
if ~isempty(ndx)
sublist{i,1}=list{ndx, 1};
sublist{i,2}=list{ndx, 2};
else
disp(sprintf('problem with input to gtSubList - field name %s not found in main list', varargin{i}))
end
end
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment