r_choose_ht.m 1.17 KB
function [h,t] = r_choose_ht(hs,tp)
% R_CHOOSE_HT - Chooses a number respectively from 1 to 3 and 1 to 10 for
% the wave height and the time period.
%
% Syntax:  [h,t] = r_choose_ht(hs,tp)
%
% Inputs:
%    hs        - The wave height
%    tp        - The time period
% Outputs:
%    h         - Number from 1 to 5
%    t         - Number from 1 tp 10
%
% Example:
%    [h, t] = r_choose_ht(2, 20)
%     h = 1 and t = 10
%
% Other m-files required: none
% Subfunctions: none
% MAT-files required: none
%
% See also: 
%
% Author: Marie-Pier Marquis, Dany Dumont
% UQAR/ISMER
% email: dany_dumont@uqar.ca
% Website: http://www.ismer.ca/dumont-dany
% July 2014
% ______________________________________________________________________
%%
if     hs == 2
    h = 1;
elseif hs == 3
    h = 2;
elseif hs == 4
    h = 3;
elseif hs == 6
    h = 4;    
elseif hs == 8
    h = 5;
elseif hs == 10
    h = 6;
end
if     tp == 6.5
    t = 1;
elseif tp == 8.0
    t = 2;
elseif tp == 9.5
    t = 3;
elseif tp == 11.0
    t = 4;
elseif tp == 12.5
    t = 5;
elseif tp == 14.0
    t = 6;
elseif tp == 15.5
    t = 7;
elseif tp == 17.0
    t = 8;
elseif tp == 18.5
    t = 9;
elseif tp == 20.0
    t = 10;
end
end