function name = inline(expr) % inline - Emulates the Matlab "inline" function for octave % % Parameter: expr String to create as a function % % Reference: % Matlab - Octave compatibility function %% =========================================================================== %% =========================================================================== % Copyright (C): % 2002-2003 by Forschungszentrum Telekommunikation Wien, Austria; % All rights reserved. % Project : FTW's xDSLsimu % Author(s) : Petr Kadlec (kadlec@ftw.at) % : Tomas Nordstrom (Tomas.Nordstrom@FTW.at) % % CVS: $Id: inline.m,v 3.1 2002/12/27 16:15:18 tono Exp $ %% =========================================================================== % Change History % 2002-07-01 (PeKa) Created for Octave to Matlab compatibility port %% =========================================================================== while (1) name = sprintf('__inline%d',rand(1)*100000); if !exist(name), break; end eval('function __return=', name, ... '(x)\n __return=', expr, '; end'); end