from
MatPlanWDM v0.5
by Pablo Pavon MariƱo Educational network planning tool for the RWA problem in WDM networks (MILP and heuristic based)
sec2time.m
% sec2time
%
%>> Usage: [h, min, sec]=sec2time(seconds)
%
%>> Abstract: This function converts time expressions in seconds to time expressions in hours, minutes and seconds.
%
%>> Arguments:
% o In:
% seconds: Input time expression in seconds. It is a real value.
%
% o Out
% . h: Number of hours of the input expression. It is an integer value.
%
% . min: Number of minutes of the input expression. It is an integer value.
%
% . sec: Number of seconds of the input expression. It is a real value.
%
%
function [h, min, sec]=sec2time(seconds)
if (nargin==0), help sec2time;return, end %help calling
if (nargin~=1), error('error 1: Incorrect number of arguments.'),end %Number of input arguments different of 1
t=datenum(0, 0, 0, 0, 0, seconds);
sec=second(t);
min=minute(t);
h=hour(t);