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.
Back and Forth Rows
Create a vector whose elements depend on the previous element
Matlab Basics - Switching Assignments
Add the positive numbers
Count the numbers
Add the odd 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