home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l455 / 2.ddi / MUTOOLS1.DI$ / COS_TR.M < prev    next >
Encoding:
Text File  |  1993-03-11  |  595 b   |  22 lines

  1. % function out = cos_tr(freq,mag,tinc,lastt)
  2. %
  3. %   Generates a VARYING matrix containing a cosine signal:
  4. %     FREQ  - frequency (radians/second)
  5. %     MAG   - magnitude of cosine signal
  6. %     TINC  - time increment 
  7. %     LASTT - final time (note the signal starts at time t=0)
  8.  
  9. function out = cos_tr(freq,mag,tinc,lastt)
  10.  
  11.  if nargin < 4
  12.    disp('usage: out = cos_tr(freq,mag,tinc,lastt)')
  13.    return
  14.  end
  15.  
  16.  tvec = 0:tinc:lastt;
  17.  y = mag*cos(freq*tvec);
  18. %out = [ [y.' tvec.'] ; max(size(y)) inf];
  19.  out = vpck(y.',tvec.');
  20. %
  21. % Copyright MUSYN INC 1991,  All Rights Reserved
  22.