Home > wafo > spec > freqtype.m

freqtype

PURPOSE ^

returns the frequency type of a Spectral density struct.

SYNOPSIS ^

ftype=freqtype(S)

DESCRIPTION ^

  FREQTYPE returns the frequency type of a Spectral density struct.
 
  CALL: ftype = freqtype(S)
 
   ftype = 'f' if frequency is given in Hz
           'w' if frequency is given in rad/s
           'k' if a wave number spectrum is given
       S = spectral density struct
 
  See also  datastructures

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

01 function ftype=freqtype(S)
02 % FREQTYPE returns the frequency type of a Spectral density struct.
03 %
04 % CALL: ftype = freqtype(S)
05 %
06 %  ftype = 'f' if frequency is given in Hz
07 %          'w' if frequency is given in rad/s
08 %          'k' if a wave number spectrum is given
09 %      S = spectral density struct
10 %
11 % See also  datastructures
12 
13 % History:
14 %  revised pab 17.02.2000
15 % - updated header
16 % revised pab 24.01.2000
17 %  - added check if field exist
18 % by pab 
19 
20 names=fieldnames(S); 
21 ind=find(strcmp(names,'f')+strcmp(names,'w')+strcmp(names,'k')); %options are 'f' and 'w' and 'k' 
22 if isempty(ind)
23   warning('This is not a spectral density structure')
24   ftype=[];
25 else
26   ftype=lower(names{ind}); 
27 end

Mathematical Statistics
Centre for Mathematical Sciences
Lund University with Lund Institute of Technology

Comments or corrections to the WAFO group


Generated on Thu 06-Oct-2005 02:21:16 for WAFO by m2html © 2003