function [gen, B, C, D, N, K, M, n_std_sta] = simviter(gen);
%SIMVITER SIMULINK mask file to convert GEN into SIMULINK required parameters.
%       TRAN_FUNC = SIMVITER(GEN) converts convolution structure
%       defined in SIMULINK file (string) into the parameters defined in 
%       TRAN_FUNC = [[A, B; C, D], [N;K;M;zeros(...);-Inf] form. If GEN is
%       not a string, this form does nothing.
%
%       [A, B, C, D] = SIMVITER(GEN) outputs [A, B, C, D] of the state system.
%       GEN can be the input or output of the first form of calling this
%       function.
%
%       [A, B, C, D, N, K, M, N_STATE] = simviter(gen)
%
%       See also GEN2ABCD, SIM2TRAN.

%   Copyright 1996-2000 The MathWorks, Inc.
%   $Revision: 1.11 $
%       Wes Wang 9/13/94

if isstr(gen)
    gen = sim2tran(gen);
end;

if nargout > 1
    [gen, B, C, D, N, K, M] = gen2abcd(gen);
else
    gen=gen2abcd(gen);
end;

if nargout > 7
    n_std_sta = 2^M;
end;

%end simviter.m
