1st simple program :
clc;
close all;
clear;
N=7;
m=0:6;
xk=cos(2*pi*(m/N))
figure ;
plot(m,xk);
xlabel('m values');
ylabel('xk values');
output values:
xk =
1.0000 0.6235 -0.2225 -0.9010 -0.9010 -0.2225 0.6235
considering m values 0,0to1,1to2,2to3,3 to4,4to5,5to6 with incremnt 0.1
clc;
close all;
clear;
N=7;
m=0;
xk1=cos(2*pi*(m/N))
figure (1);
plot(m,xk1)
subplot(7,1,1);
xlabel('m values');
ylabel('xk1 values');
m=0:0.1:1;
xk2=cos(2*pi*(m/N))
plot(m,xk2)
subplot(7,1,2);
xlabel('m values');
ylabel('xk2 values')
m=1:0.1:2;
xk3=cos(2*pi*(m/N))
plot(m,xk3)
subplot(7,1,3);
xlabel('m values');
ylabel('xk3 values');
m=2:0.1:3;
xk4=cos(2*pi*(m/N))
plot(m,xk4)
subplot(7,1,4);
xlabel('m values');
ylabel('xk4 values');
m=3:0.1:4;
xk5=cos(2*pi*(m/N))
plot(m,xk4)
subplot(7,1,5);
xlabel('m values');
ylabel('xk5 values');
m=4:0.1:5;
xk6=cos(2*pi*(m/N))
plot(m,xk6)
subplot(7,1,6);
xlabel('m values');
ylabel('xk6 values');
m=5:0.1:6;
xk7=cos(2*pi*(m/N))
plot(m,xk7)
subplot(7,1,7);
xlabel('m values');
ylabel('xk7 values');
outputs:
xk1 =
1
xk2 =
1.0000 0.9960 0.9839 0.9640 0.9362 0.9010 0.8584 0.8090 0.7531 0.6911 0.6235
xk3 =
0.6235 0.5509 0.4739 0.3930 0.3090 0.2225 0.1342 0.0449 -0.0449 -0.1342 -0.2225
xk4 =
-0.2225 -0.3090 -0.3930 -0.4739 -0.5509 -0.6235 -0.6911 -0.7531 -0.8090 -0.8584 -0.9010
xk5 =
-0.9010 -0.9362 -0.9640 -0.9839 -0.9960 -1.0000 -0.9960 -0.9839 -0.9640 -0.9362 -0.9010
xk6 =
-0.9010 -0.8584 -0.8090 -0.7531 -0.6911 -0.6235 -0.5509 -0.4739 -0.3930 -0.3090 -0.2225
xk7 =
-0.2225 -0.1342 -0.0449 0.0449 0.1342 0.2225 0.3090 0.3930 0.4739 0.5509 0.6235
please check 2nd program all output last values compare to 1st program output values
they must be equal
(MATLAB) In the same figure plot 7 vertically arranged DT sinusoids x k (m)=cos*2*pi*m/N, m=0,1,...6, using...
MATLAB) In the same figure plot 6 vertically arranged DT sinusoids x k (m)=cos 2*k*pi*m/6, k=0,1,...5, using the function subplot(6,1,p).
2. Let x[n] =cos((pi*n)/8) for -16 <= n <= 16 . On the same stem diagram, plot x(n) and x(n- 4). You should use the sigshift function to complete this exercise.
solve all questions simply by using matlab. write all step here please 1Normal 1 No Spac Heading1 Heading 2 DISCUSSION Solve all tasks given below: 1. Consider function f(x) 3.5-0.5x cos(6x) for the value of x between -2.0 until 4.0. Draw the plot in dash line and in red colour, Label the title and all axes. 2. Consider the following functions for 0sxS pi: x() 10e0.St sin(3t +2) y(t) 7e-04t cos(5t - 3) (a) Draw both graphs on the same...
MATLAB %% T = 1; N = 11; np = 2; dt = 0.001; tmax = np*T; t = -tmax:dt:tmax; %% Function 1 %the following code was used to create the x(t) function xrange = floor((T/dt)/15); x1 = linspace(0,1,xrange); x2 = x1(end-1:-1:1); x3 = linspace(0,2,2*xrange); x4 = x3(end-1:-1:1); x5 = zeros(1,xrange); x6 = x1; x7 = 2*ones(1,xrange); x8 = 1+x2; x9 = -0.5*ones(1,xrange); x10 = x1/2-0.5; xtemp = [x1 x2 x3 x4 x5 x6 x7 x8 x9 x10]; ztemp =...
Results for this submission Entered Answer Preview Result (3/2)+(6/pi)*cos(x) e + cos(2) correct (3/2)+(6/pi)*cos(x)-(2/pi)*cos(3*x) 3 6 st-ce 2 s(3x) correct (3/2)+(6/pi)*cos(x)-(2/pi)*cos(3*x)+(6/5)*pi*cos(5*x) it coule) = _ cou(30) + * cos(52) incorrect A correct f(x) f(x) correct At least one of the answers above is NOT correct. 1 (1 point) (a) Suppose you're given the following Fourier coefficients for a function on the interval (-1,7): a 3 6 6 6 = , ai = –, az = -2,25 = = and 22,...
In MATLAB The value of cos(x) can be approximated using a Maclaurin series + +... cos(x)=1-1 2! 4! 6! Which can be expressed compactly as cos(x) = {(-1)+7 (2(k-1))! 00 2(k-1) k-1 Write Matlab code using a while loop that calculates cos(2) with 5 terms of Maclaurin series. Compare the value with the one calculated with a built-in function cos (2) in Matlab. The following is an expected output from your code: Using the Maclaurin series cos( 2.0) with 5...
Find the integral using matlab quad inbuilt for function (x^2)*cos(x)+3*sin(x)*tan(x) for 0 to pi/4
Using Matlab: If x(n) = cos(5π e-n/10) over n=[-10:30] and y(m)=sin(0.03πem/20) over m=[0:40], find z = x*y and its support vector k. Here * means convolution. Stem plot the results setting the axes using the command axis([-20,80,-2. .5,2.5]).
Using Matlab, plot the following ultrasound pressure wave as a function of x for t = 1 P(t, x) = P_0 e^- x cos(omega t - beta x) Where alpha = 0.1 neper/m, where neper is a dimensionless quantity, beta = 1 rad/min, omega = 1 red/s, P_0 = 10 N/m^2. Submit your ".m" file as the resulting graph labeled appropriately.
M-file dft.m function Xk = dft(x) [N,M] = size(x); if M ~=1, % makes sure that x is a column vector x = x'; N = M; end Xk=zeros(N,1); n = 0:N-1; for k=0:N-1 Xk(k+1) = exp(-j*2*pi*k*n/N)*x; end Using the MATLAB M-file dft, compute the 32-point DFT of rn cos(₩), 0 〈 n < 10, x[n] 0 for all other n. COS