Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99923553
cfg2struct.m
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Jan 27, 07:31
Size
1018 B
Mime Type
text/plain
Expires
Wed, Jan 29, 07:31 (1 d, 4 h)
Engine
blob
Format
Raw Data
Handle
23860664
Attached To
R6832 iCAPs public
cfg2struct.m
View Options
function sitem = cfg2struct(item)
% function sitem = cfg2struct(item)
% Return a struct containing all fields of item plus a field type. This is
% the method suitable for cfg_choice and repeat classes. It descends down
% the values field to convert the cfg_items in this field into structs.
%
% This code is part of a batch job configuration system for MATLAB. See
% help matlabbatch
% for a general overview.
%_______________________________________________________________________
% Copyright (C) 2007 Freiburg Brain Imaging
% Volkmar Glauche
% $Id: cfg2struct.m 1716 2008-05-23 08:18:45Z volkmar $
rev = '$Rev: 1716 $'; %#ok
% Get parent struct, re-classify as field 'type'
sitem = cfg2struct(item.cfg_item);
sitem.type = class(item);
% Need to cycle through added fields
fn = mysubs_fields;
for k = 1:numel(fn)
sitem.(fn{k}) = item.(fn{k});
end;
% Treat values{:} fields
if numel(item.values) > 0
for k = 1:numel(item.values)
sitem.values{k} = cfg2struct(item.values{k});
end;
end;
Event Timeline
Log In to Comment