Question: Using Matlab only answer the following. 04. In an experimental setup, the measurement is recorded in intervals of seconds. Write a script pt the user
04. In an experimental setup, the measurement is recorded in intervals of seconds. Write a script pt the user to enter the time duration in seconds and return the equivalent combined 2 of 3 days, hours, minutes and seconds (use fprint such thati quantities with non-zero values in the output (e.g., for input of 86400 seconds return "1 d" NOT "O wk, 1 d, 0 hr, 0 min, 0 sec") Give larger units precedence over smaller ones as much as possible (e.g, for input of 130 sec return 2 min, 10 sec NOT 1 min, 70 sec or 130 sec) Consider the following conversion formulas unit suffix used in output week wk Day hour hr minute mi second sec conversion I week-7 days Iday 24 hours hour-60 minutes l minutes 60 seconds Test your code using the following cases input number 100 7259 86400 6000000 output 1 min, 40 sec 2 hr, 59 sec 9 wk, 6 d, 10 hr, 40 min
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
