IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
ircode_eval.m
Go to the documentation of this file.
1 %> @ingroup globals codegen
2 %> @file
3 %> @brief Evaluates code in 'base' workspace, adds to IRCODE.s and to the IRootLab log editbox if open
4 %>
5 %> @param s code
6 %> @param title if provided, will be added before the code as comment
7 function ircode_eval(s, title)
9 
10 if exist('title', 'var')
11  s = ['%' title sprintf('\n') s];
12 else
13  title = '';
14 end;
15 % s = [sprintf('\n') s];
16 
17 
18 % Does same thing but without the ircode_assert()
19 try
20  t = tic();
21  ircode_eval2(s, title);
22  tt = toc(t);
23  if tt > 0.5
24  ircode_eval2(sprintf('% -- Ellapsed time: %g seconds\n', tt));
25  end;
26 catch ME
27 % ircode_eval2(['% -- ERROR at ', datestr(now), 10, 10]);
28  rethrow(ME);
29 end;
30 
31 
function ircode_eval(in s, in title)
function ircode_assert()
Analysis Session (AS) base class.
Definition: as.m:6
function ircode_eval2(in s, in title)