LAGTYPE Returns the lag type of a Covariance struct. CALL: ltype = lagtype(R) ltype = Character vector containing: 'x' if lag of first space dimension is given. 'y' if lag of second space dimension is given. 't' if time lag is given R = Covariance function structure Example: R = spec2cov(jonswap); lagtype(R) See also datastructures
Create character array (string). | |
Get structure field names. | |
Compare strings. | |
Display warning message; disable or enable warning messages. |
Simulates a Gaussian process and its derivative | |
Simulates a Gaussian process and its derivative from spectrum |
01 function ltype = lagtype(R) 02 %LAGTYPE Returns the lag type of a Covariance struct. 03 % 04 % CALL: ltype = lagtype(R) 05 % 06 % ltype = Character vector containing: 07 % 'x' if lag of first space dimension is given. 08 % 'y' if lag of second space dimension is given. 09 % 't' if time lag is given 10 % R = Covariance function structure 11 % 12 % Example: 13 % R = spec2cov(jonswap); 14 % lagtype(R) 15 % 16 % See also datastructures 17 18 % Tested on: matlab 5.2 19 % History: 20 % by pab 11.10.2001 21 22 names=fieldnames(R); 23 ind=find(strcmp(names,'x')+strcmp(names,'y')+strcmp(names,'t')); %options are 'x' and 'y' and 't' 24 if isempty(ind) 25 warning('This is not a Covariance structure') 26 ltype=[]; 27 else 28 ltype=char(names(ind)).'; 29 end 30
Comments or corrections to the WAFO group