Question

Use matlab date commands to determine the date of Thanksgiving for the next 10 years (always...

Use matlab date commands to determine the date of Thanksgiving for the next 10 years (always on fourth thursday on month).
0 0
Add a comment Improve this question Transcribed image text
Answer #1

`Hey,

Note: Brother if you have any queries related the answer please do comment. I would be very happy to resolve all your queries.

clc
clear all
close all
for i=2020:2029
fprintf('Thanksgiving day for %d year is %d-11-%d\n',i,getDate(i),i);
end
function y=getDate(n)
ct=0;
y=1;
for i=1:30
t = datetime(n,11,i);
d = day(t,'dayofweek');
if(d==5)
ct=ct+1;
end
if(ct==4)
y=i;
return;
end
end
end

Kindly revert for any queries

Thanks.

Add a comment
Know the answer?
Add Answer to:
Use matlab date commands to determine the date of Thanksgiving for the next 10 years (always...
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
  • Matlab Provide the MATLAB commands needed to determine the solution to the following system of equations...

    Matlab Provide the MATLAB commands needed to determine the solution to the following system of equations in a MATLAB program (linearequation.m). Use MATLAB to check the solution by multiplying coefficient matrix A with the solution vector x, to produce b. That is, Ax = b. w + 3x + 4y = 31 2w + x + 3y + z = 27 9x + 7y + 2z = 72 4w + 3x + 2y + 2z = 27.

  • PLEASE USE MATLAB COMMANDS THANK YOU Use Matlab to graph the functions f(x) = 3xsin(3x) and...

    PLEASE USE MATLAB COMMANDS THANK YOU Use Matlab to graph the functions f(x) = 3xsin(3x) and g(x)= 12 - 2x² so that you can read off the point(s) of intersection (if any), accurate up to two decimal places. 1) Write down the Matlab command(s) you used to create the x-vector. 2) Write down the Matlab command(s) you used to produce the vectors containing the f- and g-function values. 3) Write down the Matlab command(s) you used to plot the graphs....

  • For all questions, write commands in Matlab (or Octave) that you would use to solve the...

    For all questions, write commands in Matlab (or Octave) that you would use to solve the exercises, not the result. For all exercises, you must write the commands that you would use to solve them, not the result 1. Compute sin(/5), e2v17 +4.(-33) 2. Write an anonymous function with the formula f) sin 2 3. 3. Write the function above so that it can be applied to vectors of arguments 4. Graph the function from-5 to 5 How would you...

  • Exercise 1: Use Matlab command to obtain the following a) Extract the fourth row of the...

    Exercise 1: Use Matlab command to obtain the following a) Extract the fourth row of the matrix generated by magic(6) b) Show the results of 'x' multiply by 'y' and 'y' divides by 'x'. Given x = [0:0.1:1.1] and y=[10:21] c) Generate random matrix 'r' of size 4 by 5 with number varying between -8 and 9 Exercise 2: Use MATLAB commands to get exactly as the figure shown below x=pi/2:pi/10:2*pi; y=sin(x); z=cos (x);

  • Exercise 1 (Transfer Function Analysis) MATLAB provides numerous commands for working with polyno...

    Please do part C only, thank you. Exercise 1 (Transfer Function Analysis) MATLAB provides numerous commands for working with polynomials, ratios of polynomials, partial fraction expansions and transfer functions: see, for example, the commands roots, poly, conv, residue, zpk and tf (a) Use MATLAB to gener ate the continuous-time transfer function H5+15)( +26(s+72) s(s +56)2(s2 +5s +30) H(s) displaying the result in two forms: as (i) the given ratio of factors and (ii) a ratio of two polynomials. (b) Use...

  • 3. (3 points) Write the sequence of MATLAB commands that you would use to produce a...

    3. (3 points) Write the sequence of MATLAB commands that you would use to produce a plot depicting the rotini-like surface defined by: for radii (r) going from 0 to 1 (21 values) and angles (θ) going from-10π to 10π (501 values). Your sequence of commands should define rectangular grids of radii and angles, transform them to cartesian coordinates (x.y), compute z, and plot the result as a solid surface, without gridlines (use shading command), with equally scaled x, y...

  • This is matlab questions,please use Julia and give me Julia commands process to slove the questions....

    This is matlab questions,please use Julia and give me Julia commands process to slove the questions. (3) Find an interval [a,b] on which f(x) = x cos(x) and gle) = 7 / 7 satisfies g(x)=f(). Your interval must be in [0,2]. have endpoints accurate to the nearest thousandth, and be as large as possible. Construct a graph showing both fanda on [o, 2] and on which your interval is. visible. (2) Let g(x) = x'+1+56 log 14-3x). The function has...

  • Need help with this MatLab exercise. Please show all commands in MatLab. Enter the following matrices...

    Need help with this MatLab exercise. Please show all commands in MatLab. Enter the following matrices and vectors in MATLAB [ 2 -6 3 ] [ 5 ] -3 A= 2 -7 -2 , B= 2 -2 -3 , b= -13 , c= 3 -1 4], d= 0 [ 7 -2 7 [1 -8 -1 ] [ 10 (a) Perform the following operations: AB, BA, CA and Bd (use standard linear algebra multiplication). - 3 (b) Construct a 6 x...

  • İn MatLab  (please don't use any find sum or zeros commands only use loops) 4) Write a...

    İn MatLab  (please don't use any find sum or zeros commands only use loops) 4) Write a function that takes a matrix and puts its columns into reverse order. Example: Input 6 2 1 8 6 5 | 4 1 6 4 3 8 0 5 2 5 Output 3 0 1 5 8 2 3 5 3 1 8 3 4 4 3 8 6 5 4 4

  • Please use MATLAB programming as this is what we use for class thank you. 39. The...

    Please use MATLAB programming as this is what we use for class thank you. 39. The following MATLAB commands create a sine-sha ped signal y(t) that contains random noise: t = 0: .05:10; y sin (t)-0.1+0.2 rand (1,length (t)) Write a MATLAB program that uses these commands to create a noisy sine-shaped signal. Then the program smooths the signal by using the three- points moving-average method. In this method the value of every point i except the first and last,...

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
ADVERTISEMENT