comparison m-toolbox/classes/@LTPDAworkbench/fromM.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1 % FROMM constructs an LTPDA workbench from an LTPDA script file.
2 %
3 % M Hewitson 17-11-08
4 %
5 % $Id: fromM.m,v 1.3 2010/09/17 14:09:47 ingo Exp $
6 %
7 function wb = fromM(wb, fname)
8
9 wb = LTPDAworkbench();
10
11 cmds = {};
12
13 % get file parts
14 [pathstr,name,ext] = fileparts(fname);
15 min = textread(fname,'%s','delimiter','\n','whitespace','');
16
17 for kk=1:numel(min)
18 line = strtrim(min{kk});
19 % Exceptions:
20 % empty lines
21 % comment lines
22 % mc
23 if ~isempty(line) && ...
24 line(1) ~= '%' && ...
25 ~strcmp(line, 'mc')
26
27 cmds = [cmds min(kk)];
28 end
29 end
30
31 % Now build the pipline
32 wb.cmds2pipeline(fname, cmds);
33
34 end
35