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
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
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...
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...
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,...
Write the algorithm for this program using the C++ language (not python or java). The explanation...
Write the algorithm for this program using the C++ language (not python or java). The explanation needs to be at least 250 words. Explain everything throughly step by step. While there is a built-in pop_back function in the vector class, there is no built-in pop_front function. Suppose a program needs a pop_front function that will remove the first element from the vector. For example, if the original vector is [1, 2, 3, 4, 5], then after passing in this vector...
write an algorithm ( pseudocode in c) which counts the number of element larger than P...
write an algorithm ( pseudocode in c) which counts the number of element larger than P bit smaller than Q.
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT