gistlib
main.mfunction [days, hours, mins, seconds] = convertSeconds(totalSeconds) % Calculate days days = floor(totalSeconds / (24 * 3600)); % Calculate remaining seconds after days remainingSeconds = totalSeconds - days * 24 * 3600; % Calculate hours hours = floor(remainingSeconds / 3600); % Calculate remaining seconds after hours remainingSeconds = remainingSeconds - hours * 3600; % Calculate minutes mins = floor(remainingSeconds / 60); % Calculate remaining seconds after minutes seconds = remainingSeconds - mins * 60; end 591 chars20 lines
function [days, hours, mins, seconds] = convertSeconds(totalSeconds) % Calculate days days = floor(totalSeconds / (24 * 3600)); % Calculate remaining seconds after days remainingSeconds = totalSeconds - days * 24 * 3600; % Calculate hours hours = floor(remainingSeconds / 3600); % Calculate remaining seconds after hours remainingSeconds = remainingSeconds - hours * 3600; % Calculate minutes mins = floor(remainingSeconds / 60); % Calculate remaining seconds after minutes seconds = remainingSeconds - mins * 60; end
gistlibby LogSnag