www.pudn.com > communicationmatlab.rar > ARRAYSIN.M


function [sys, x0, str, ts] = arraysin(t, x, u, flag, num) 
%ARRAYSIN outputs function sin for a given vector input. 
%   This M-file is designed to be used in a SIMULINK S-function block. 
%   This function inputs NUM-array of input signal and outputs the 
%   sin function of the same array size signal. 
 
%   Wes Wang 4/13 
%       Copyright (c) 1995-96 by The MathWorks, Inc. 
 
if flag == 3 
    sys = sin(u); 
elseif flag == 0 
    sys=zeros(7,1); 
    %one sample rate 
    sys(7) = 1; 
    %to be determined input number 
    sys(4) = num; 
    %to be determined output number 
    sys(3) = num; 
    x0 = []; 
    ts = [-1, 0]; 
else 
    sys = []; 
end;