1 function expr=char2oneline(c,varargin);
\r
2 %CHAR2ONELINE Input arguments:
\r
3 % 1) expr: An cell array containing string expressions
\r
5 % Converts the cell elements to a large inline function.
\r
7 % Toolbox for nonlinear filtering.
\r
8 % Copyright (C) 2005 Jakob Rosén <jakob.rosen@gmail.com>
\r
10 % This program is free software; you can redistribute it and/or
\r
11 % modify it under the terms of the GNU General Public License
\r
12 % as published by the Free Software Foundation; either version 2
\r
13 % of the License, or (at your option) any later version.
\r
15 % This program is distributed in the hope that it will be useful,
\r
16 % but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
17 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
18 % GNU General Public License for more details.
\r
20 % You should have received a copy of the GNU General Public License
\r
21 % along with this program; if not, write to the Free Software
\r
22 % Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
\r
24 n=size(c,2); %columns
\r
27 %Convert to inline representation
\r
28 %Instead of using a cell array, we use a 2 dimensional inline
\r
29 %expression since that's a lot faster and speed is our friend...
\r
33 str=strcat(str,c{j,i},',');
\r
35 str=strcat(str(1:end-1),';');
\r
37 str=strcat(str(1:end-1),']');
\r
39 expr=inline(str,'x','t','w','u');
\r