update_config.m 1.13 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
% update_config() - Update a specified vised_config field.
%
% Usage:
%  >> update_config(config_name,option_string);
%
% Inputs:
%    config_name = vised_config structure in workspace.
%    option_string = cell array of key/value pairs to modify in the vised_config structure.
%
% See also: init_vised_config(), struct2text_ve(), text2struct_ve(), propgrid2visedconfig(), visedconfig2propgrid();
%
%Code originally written by Allan Campopiano with contributions from 
%James Desjardins and Andrew Lofts, supported by NSERC funding to 
%Sidney J. Segalowitz at the Jack and Nora Walker Canadian Centre for 
%Lifespan Development Research (Brock University), and a Dedicated Programming 
%award from SHARCNet, Compute Ontario.
%
%Copyright (C) 2013 BUCANL


Allan Campopiano's avatar
Allan Campopiano committed
21
22
function update_config(config_name,option_string)

23
disp('WARNING: This function is DEPRECATED and not supported anymore. USE AT YOUR OWN RISK!');
Allan Campopiano's avatar
Allan Campopiano committed
24

25
26
eval(['global ,' config_struct,';']);

Allan Campopiano's avatar
Allan Campopiano committed
27
28
29
30
31

for i=1:size(option_string,1)
    fieldname=option_string(i,1:strfind(option_string(i,:),',')-1);
    evalin('base',[config_name,'.',fieldname,'=',option_string(i,strfind(option_string(i,:),',')+1),';']);
end
32