Question

In: Electrical Engineering

Use for statements to find the values of x(t) = 3 cos (2?ft + 0.1) for...

Use for statements to find the values of x(t) = 3 cos (2?ft + 0.1) for t = 0,

01, 0.2, 0.3, 0.4 s when f =10, 15, and 20 Hz. Use one set ofstatements to compute the values for all three frequencies and store the results in a two-dimensional array. Use two nested for loops and double indexing.

Solutions

Expert Solution

Type the following code in MATLAB

     clc
    clear all
  
     t= 0:0.1:0.4;   
    f = 10:5:20;
   for f = 10:5:20
   for t= 0:0.1:0.4
      xt=3.*cos((2*pi.*f.*t)+0.1);

     xtt=[xt;f]           %making two d array of frequency and xt function output
end
end

REsult

xtt =

    2.9850                    %this is out put 
    10.0000                    %at 10hzfrequency    

xtt =

    2.9850
   10.0000

xtt =

    2.9850
   10.0000

xtt =

    2.9850
   10.0000

xtt =

    2.9850
   10.0000

xtt =

    2.9850
   15.0000

xtt =

   -2.9850
   15.0000

xtt =

    2.9850
   15.0000

xtt =

   -2.9850
   15.0000

xtt =

    2.9850
   15.0000

xtt =

    2.9850
   20.0000

xtt =

    2.9850
   20.0000

xtt =

    2.9850
   20.0000

xtt =

    2.9850
   20.0000

xtt =

    2.9850
   20.0000

Type the following code in MATLAB

%here we will also include time to see at what time at what frequency what is value ofx(t)

    clc
    clear all
  
     t= 0:0.1:0.4;
    f = 10:5:20;
   for f = 10:5:20
   for t= 0:0.1:0.4
      xt=3.*cos((2*pi.*f.*t)+0.1);

    xtt=[xt;f;t]                           %time parameter is included
end
end

Result

xtt =

    2.98501                    %output value of x(t)
   10.00000                     %at 10 hz frequency 
    0.00000                      %at time t=0 seconds

xtt =

    2.98501
   10.00000
    0.10000

xtt =

    2.98501
   10.00000
    0.20000

xtt =

    2.98501
   10.00000
    0.30000

xtt =

    2.98501
   10.00000
    0.40000

xtt =

    2.98501
   15.00000
    0.00000

xtt =

   -2.98501
   15.00000
    0.10000

xtt =

    2.98501
   15.00000
    0.20000

xtt =

   -2.98501
   15.00000
    0.30000

xtt =

    2.98501
   15.00000
    0.40000

xtt =

    2.98501
   20.00000
    0.00000

xtt =

    2.98501
   20.00000
    0.10000

xtt =

    2.98501
   20.00000
    0.20000

xtt =

    2.98501
   20.00000
    0.30000

xtt =

    2.98501
   20.00000
    0.40000

Related Solutions

what is the midline of 3-cos(x) and of 2-cos(x)?
what is the midline of 3-cos(x) and of 2-cos(x)?
Find the Fourier coefficients of the following signal. x(t) = 5 + 2sin(w0.t) + cos(2.w0.t) -...
Find the Fourier coefficients of the following signal. x(t) = 5 + 2sin(w0.t) + cos(2.w0.t) - 3sin(2.w0.t)
Find the absolute maximum and absolute minimum values of f(x) = cos(2x)+2 sin(x) in the interval...
Find the absolute maximum and absolute minimum values of f(x) = cos(2x)+2 sin(x) in the interval [0; pi]
Let X = {1, 2, 3}. Find all topologies T on X such that (X, T...
Let X = {1, 2, 3}. Find all topologies T on X such that (X, T ) is regular.
Use Heun's method to find the value of x at t=3 (assume the change in t=3)....
Use Heun's method to find the value of x at t=3 (assume the change in t=3). The ode is: (d^2x)/(dt^2)+(.3dx/dt)-4x=0. And the initial conditions are: x(0)=1, dx/dt (0)=0.
given the curve x(t)=t^2+3 and y(t)=2t^3-3t^2 find the following: a.) find the derivative of the curve...
given the curve x(t)=t^2+3 and y(t)=2t^3-3t^2 find the following: a.) find the derivative of the curve at t=1 b.) dind the concavity of the curve c.) graph the curve from t=0 to t=2 d.) find the area if the curve on the interval 0<=t<=2
.         Given the following non-periodic signal:    x(t) = 3 e-5t cos(12t) u(t)             Find the Fourier...
.         Given the following non-periodic signal:    x(t) = 3 e-5t cos(12t) u(t)             Find the Fourier transform expression X(ω) without using Table.             Calculate the magnitude spectrum of X(ω) for ω = π/8, π/4, and π/2
Let g(t) = 5t − 3 ln(t 2 ) − 4(t − 2)2 , 0.1 ≤...
Let g(t) = 5t − 3 ln(t 2 ) − 4(t − 2)2 , 0.1 ≤ t ≤ 3. a. Find the absolute maximum and minimum of g(t). b. On what intervals is g(t) concave up? Concave down?
Consider the vector function given below. r(t) = 2t, 3 cos(t), 3 sin(t) (a) Find the...
Consider the vector function given below. r(t) = 2t, 3 cos(t), 3 sin(t) (a) Find the unit tangent and unit normal vectors T(t) and N(t). T(t)   =    N(t)   =    (b) Use this formula to find the curvature. κ(t) =
Find the maximum and minimum values of f(x,y) = x^2 - y^3 on the disk x^2...
Find the maximum and minimum values of f(x,y) = x^2 - y^3 on the disk x^2 + y^2 ≤ 1
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT