function mfname=getmfth(eta)
%GETMFTH Gets the name of the .m-file that defines the model structure
%
%	MFNAME = getmfth(TH)
%
%	TH: The model structure defined in the THETA-format (See help theta)
%	MFNAME: The name of the m-file that defines the structure

%	L. Ljung 10-2-90,10-10-93
%	Copyright (c) 1986-95 by the MathWorks, Inc.
%	$Revision: 1.3 $  $Date: 1995/05/02 16:32:08 $

if nargin < 1
   disp('Usage: MFILE_NAME = GETMFTH(TH)')
   return
end

if ~isthss(eta),error('This is not a state-space based model!'),end
[nr,nc]=size(eta);
if eta(2,8)<4, mfname='ssmodx9';return,end
if eta(2,8)==11, mfname='ssmodx8';return,end
sspm=eta(1,8:nc);
sspm=sspm(1:max(find(sspm~=0)));
mfname=setstr(sspm);
