IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
load_sampledata.m
Go to the documentation of this file.
1 %>@brief Loads sample data by file name
2 %>@file
3 %>@ingroup ioio
4 %
5 %> @param filename
6 %> @param flag_workspace =0. Whether to drop a "ds<nn>" variable in base workspace
7 %> @return ds
8 function ds = load_sampledata(filename, flag_workspace)
9 
10 if nargin < 2 || isempty(flag_workspace)
11  flag_workspace = 0;
12 end;
13 
14 ds = dataloader.load_dataset(fullfile(get_rootdir(), 'demo', 'sampledata', filename));
15 
16 if flag_workspace
17  name_new = find_varname('ds');
18  global o; %#ok<TLEV>
19  o = ds;
20  evalin('base', sprintf('global o; %s = o;', name_new));
21  clear o;
22  irverbose(sprintf('Created variable "%s" in base workspace', name_new), 2);
23 end;
function irverbose(in s, in level)
function get_rootdir()
function load_sampledata(in filename, in flag_workspace)
function find_varname(in prefix)