Home > wafo > papers > wafodemo > wafofig4.m

# wafofig4

## PURPOSE

Directional spectra using Thorsethaugen and cos2s spreading

wafofig4

## DESCRIPTION

```  WAFOFIG4  Directional spectra using Thorsethaugen and cos2s spreading
function with s=15 (solid) and s frequency dependent (dash)```

## CROSS-REFERENCE INFORMATION

This function calls:
 mkdspec Make a directional spectrum spreading Directional spreading functions wafostamp Prints a caption "made by WAFO" in current figure. wspecplot Plot a spectral density clear Clear variables and functions from memory. hold Hold current graph. linspace Linearly spaced vector.
This function is called by:

## SOURCE CODE

```01 function wafofig4
02 % WAFOFIG4  Directional spectra using Thorsethaugen and cos2s spreading
03 %           function with s=15 (solid) and s frequency dependent (dash)
04 %
05
06
07 global  WAFOFIGNUM
08
09 if isempty(WAFOFIGNUM)
10   disp('You must start wafodemo in order to run this script')
11   clear global WAFOFIGNUM
12   return
13 end
14 global St Tp ma mb sp
15 D=spreading(51,'cos2s',0,[sp sp 2*pi/Tp 0 0],St.w,0);
16 Std=mkdspec(St,D);
17 Dw=spreading(linspace(-pi,pi,51),'cos2s',0,[sp sp 2*pi/Tp ma mb],St.w);
18 Stdw=mkdspec(St,Dw);
19
20 wspecplot(Std,1,'k-'), hold on
21 wspecplot(Stdw,1,'k--'),hold off
22 wafostamp('Figure 4','(ER)')
23```

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