Code covered by the BSD License

# Explore Experimental Data

### Alexander Ludwig Klein (view profile)

17 Mar 2012 (Updated )

The tool makes some of MATLAB's plotting and analysing functions available by a GUI

dataExpDemo1()
```function Data = dataExpDemo1()
% dataExpDemo1 Creates basic demo data for guiPlotData and shows some
% functions of the data class 'dataExp'
%-------------------------------------------------------------------------%
% Usage:
%    Data = dataExpDemo1
%
% Output:
%    Data:  dataExp object (i.e. handle object)
%
%
%-------------------------------------------------------------------------%
%   \$Revision: 0.1.0 \$  \$Date: 2012/03/16 20:33:00 \$
%-------------------------------------------------------------------------%

% create object
Data = dataExp();
% Fill with some simple data from nineteen experiments
for i=1:9
% Some "timed" data with log axis
x        = logspace(-4, 0, 100);
x(1)     = 0;
exponent = i/10;
y        = x.^exponent;
'Demo_INDEXP', '',              '',             i;
'Demo_INDEXP', 'x-value',      	'',             x;
'Demo_INDEXP', 'y-value',    	'',             y;
'Demo_INDEXP', 'y-value',    	'xNative',      'x-value';
'Demo_INDEXP', 'y-value',    	'Solution',     42
'Demo_INDEXP', 'name_dataset',   '',            sprintf('y=x^%g', exponent);
'Demo_INDEXP', 'exponent',       '',            exponent;
'Demo_INDEXP', 'random',         '',            rand});
end
for i=1:10
% Some "timed" data with linear axis. Use the xIncrement description to
% describe the corresponding x-axis. Note: Saving x-value would not be
% necessary in such a case
x         = linspace(0,1,100);
exponent  = i;
y         = x.^exponent;
'Demo_INDEXP', '',              '',             i;
'Demo_INDEXP', 'x-value',        '',            x;
'Demo_INDEXP', 'y-value',        '',            y;
'Demo_INDEXP', 'y-value',        'xIncrement', [mean(diff(x)) 0];
'Demo_INDEXP', 'name_dataset',   '',           sprintf('y=x^%g', exponent);
'Demo_INDEXP', 'exponent',       '',           exponent;
'Demo_INDEXP', 'random',         '',           rand});
end
% Set name, unit and comment for the UID(s) and SUBUID(s). A comment for
% each experiment is not given here.
Data.setUIDName({...
'x-value',          'time';
'y-value',          'pressure';
'name_dataset',     'dataset name';
'exponent',         'exponent i of function y=x^i'});
Data.setUIDUnit({...
'x-value',          'days';
'y-value',          'bar';
'name_dataset',     '';
'exponent',         ''});
Data.setUIDComment({...
'x-value',          'x axis of the function';
'y-value',          'y axis of the function';
'name_dataset',     'Name of dataset';
'exponent',         ''});
Data.setSUBName({...
'xIncrement',       'xIncrement';
'xNative',          'xNative'});
Data.setSUBUnit({...
'xIncrement',       'days'});
Data.setSUBComment({...
'xIncrement',       'used for plotting tools';
'xNative',          'used for plotting tools'});
% Set comment for experiment
strComment = repmat({['Experiment performed on: ' datestr(now)]}, numel(Data.allEXP), 1);
Data.setEXPComment(Data.allEXP, strComment);
end
```