The arrays x and y contain time values in the form of:
x = [hours minutes seconds]
Create the output z which contains the absolute difference in time between x and y in seconds.
x = [10 5 31];
y = [10 4 31];
z should be:
z = 60;
I added more test cases to make this problem less trivial.
Make the vector [1 2 3 4 5 6 7 8 9 10]
Number of digits in an integer
03 - Matrix Variables 1
Sum of series I
Times 3 problem
Add the odd numbers
Add the even numbers
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office