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.
Indexed Probability Table
Add two numbers
Side of a rhombus
Odd times even numbers in a matrix
Remove multiples of N
Add the positive numbers
Magnitude of a vector
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