Question

​Use Matlab date commands to find out the date of Memorial Day for the next 5...

Use Matlab date commands to find out the date of Memorial Day for the next 5 years (always the last Monday in May).

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Code:

today=datetime;
thisYear=today.Year;
nextFiveYears=thisYear+[1:5];
lastMondayForFiveYears=lweekdate(2, nextFiveYears, 5);%2 means monday, 5 means may this is getting last monday of may for five years
nextFiveMemorialDays=datestr(lastMonday);
disp("Next Five Memorial Days :")
disp(nextFiveMemorialDays);

Output:

Add a comment
Know the answer?
Add Answer to:
​Use Matlab date commands to find out the date of Memorial Day for the next 5...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT