get data for item FORMAT [res o errf] = get_item_data(o, item); o - object item - name of item to get data for If the item contains no data, GUI set is assumed data is loaded from data filename if empty. Returns res - data for item o - object, which may have been modified if has done GUI set errf - flag is 1 if data modification was attempted but failed $Id$
0001 function [res, o, errf] = get_item_data(o, item) 0002 % get data for item 0003 % FORMAT [res o errf] = get_item_data(o, item); 0004 % 0005 % o - object 0006 % item - name of item to get data for 0007 % 0008 % If the item contains no data, GUI set is assumed 0009 % data is loaded from data filename if empty. 0010 % 0011 % Returns 0012 % res - data for item 0013 % o - object, which may have been modified if has done GUI set 0014 % errf - flag is 1 if data modification was attempted but failed 0015 % 0016 % $Id$ 0017 0018 if nargin < 2 0019 error('Need item'); 0020 end 0021 errf = 0; 0022 if isempty_item_data(o, item) 0023 [o errf] = do_set(o, item, 'set_ui'); 0024 end 0025 I = get_item_struct(o, item); 0026 res = I.data; 0027 if isempty(res) & ~isempty(I.file_name) 0028 res = load(I.file_name, ['-' I.file_type]); 0029 end 0030 0031