Question

Write an algorithm for finding the day of the date which is 37 days after today....

Write an algorithm for finding the day of the date which is 37 days after today. Implement your algorithm in Matlab.

Homework Answers

Answer #1

For the given problem we will need two functions to be used in matlab
the first is datetime() finction which gives us datetime, when the argument is 'now'
hence datetime('now') givens date and time of right now
now to add 37 days to todays time and date, we can use days() finction with argument being number of days we want to add
hence

the following is the matlab code
tnow = datetime('now') % take todays daytime and save in variable tnow
tthen = tnow + days(37) % add 37 days to tnow to get tthen


Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Give an algorithm for finding the second largest integer in a finite sequence of integers. Write...
Give an algorithm for finding the second largest integer in a finite sequence of integers. Write the algorithm in pseudocode format
Write a MATLAB program that implements the Insertion Sort algorithm. Test your implementation with this set...
Write a MATLAB program that implements the Insertion Sort algorithm. Test your implementation with this set of inputs: 16.2 32.7 -0.5 4.4 21.8 -17.0 6.9 14.1 1.5.
Briefly distinguish between Arrays and Linked List. Write an algorithm for each as well as develop...
Briefly distinguish between Arrays and Linked List. Write an algorithm for each as well as develop computer programs that implement each of them. Show the results of your output including your code.
A radioactive substance decays at a continuous rate of 8.6% per day. After 15 days, what...
A radioactive substance decays at a continuous rate of 8.6% per day. After 15 days, what amount of the substance will be left if you started with 100 mg? (a) First write the rate of decay in decimal form. r= (b) Now calculate the remaining amount of the substance. Round your answer to two decimal places
Please read the requirements: Write a C++ function, date, that will accept a date via a...
Please read the requirements: Write a C++ function, date, that will accept a date via a parameter in the month-day-year format, mmddyyyy, (e.g., 10262020 stands for the date October 26, 2020), and then will determine the corresponding month number, day, and year of that date, returning these three integer values to the calling function via arguments. An example of a call to the function date is shown in the following statement: date (10262020, month, day, year); This call to the...
USING C++. The following divide-and-conquer algorithm is proposed for finding the simultaneous maximum and minimum: If...
USING C++. The following divide-and-conquer algorithm is proposed for finding the simultaneous maximum and minimum: If there is one item, it is the maximum and minimum, and if there are two items, then compare them, and in one comparison you can find the maximum and minimum. Otherwise, split the input into two halves, divided as evenly as possibly (if N is odd, one of the two halves will have one more element than the other). Recursively find the maximum and...
Write a Python program that reads in the month, day, and year of a date and...
Write a Python program that reads in the month, day, and year of a date and prints it in the dd/mm/yyyy format or mm/dd/yyyy format, the format depending on the user’s preference. The program also prints the message It is a magic date If the product of month and day is equal to the last two digits of the year. For example, April 20 1980 is a magic date because April (numeric value 4) multiplied by 20 is equal to...
February 18 is a special date for the CCC this year. Write a program that asks...
February 18 is a special date for the CCC this year. Write a program that asks the user for a numerical month and numerical day of the month and then determines whether that date occurs before, after, or on February 18. If the date occurs before February 18, output the word Before. If the date occurs after February 18, output the word After. If the date is February 18, output the word Special. Input The input consists of two integers...
Suppose the credit terms offered to your firm by its suppliers are 2/10, net 30 days....
Suppose the credit terms offered to your firm by its suppliers are 2/10, net 30 days. Your firm is not taking discounts, but is paying after 25 days instead of waiting until Day 30. You point out that the nominal cost of not taking the discount and paying on Day 30 is approximately 37%. But since your firm is neither taking discounts nor paying on the due date, what is the effective annual percentage cost of its non-free trade credit,...
The binary search algorithm given in this chapter is nonrecursive. Write and implement a recursive version...
The binary search algorithm given in this chapter is nonrecursive. Write and implement a recursive version of the binary search algorithm. The program should prompt Y / y to continue searching and N / n to discontinue. If an item is found in the list display the following message: x found at position y else: x is not in the list Use the following list of integers when testing your program: 2, 6, 8, 13, 25, 33, 39, 42, 53,...