Home > wafo > spec > demospec.m

demospec

PURPOSE ^

Loads a precreated spectrum of chosen type

SYNOPSIS ^

S=demospec(stype)

DESCRIPTION ^

  DEMOSPEC Loads a precreated spectrum of chosen type
 
  CALL:  S=demospec(stype)
 
        S = spectrum struct
    stype = string 'freq' or 'dir' (default 'freq')
 
  Spectra of types 'freq' and 'dir' are available
  and can be used as test or demo examples.
  Any other type is possible to get using SPEC2SPEC
 
  See also  createspec, datastructures, spec2spec

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

001 function S=demospec(stype)
002 % DEMOSPEC Loads a precreated spectrum of chosen type
003 %
004 % CALL:  S=demospec(stype)
005 %
006 %       S = spectrum struct
007 %   stype = string 'freq' or 'dir' (default 'freq')
008 %
009 % Spectra of types 'freq' and 'dir' are available
010 % and can be used as test or demo examples.
011 % Any other type is possible to get using SPEC2SPEC
012 %
013 % See also  createspec, datastructures, spec2spec
014 
015 % Tested on: Matlab 5.3
016 % History: 
017 % revised by es 05.06.00 changed call to SPREADING since spreading changed
018 %  by es 21.12.1999 m-file calls instead of mat-files
019 %  by es 23.09.1999
020 
021 if nargin<1|isempty(stype)
022   stype='freq';
023 end
024 
025 if strcmp(lower(stype),'freq')
026   S=jonswap(linspace(0,1.14,257));
027 else
028   S=jonswap(linspace(0,1.14,257));
029   D=spreading(linspace(-pi,pi,101),'cos2s',0,15,S.w,0);
030   S=mkdspec(S,D);
031 end
032 S.note=['Demospec: ',S.note,', truncated at 2*wp'];
033 
034

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