Part A:
Write a generic Matlab code that generates delayed (shifted) Unit
Impulse function.
Part B:
Write a generic Matlab code that generates delayed (shifted) Unit step function.
Part C:
Write a generic Matlab code that generate delayed (shifted) Unit ramp function.
A)
%%
clc;
clear all;
close all;
%
delay=1;% Set the delay variable according to the
requirement
%
total_time=4*delay;
k=1;
loc=0;
for t=0:total_time/1000:total_time
if(t==delay)
loc=k;
end
signal(k)=0;
time(k)=t;
k=k+1;
end
%%
plot(time,signal,'r')
hold on
stem(time(loc),1,'r')
hold off
grid on
xlabel('Time(s)')
ylabel('Amplitude')
%%
B)
%%
clc;
clear all;
close all;
%
delay=1;% Set the delay variable according to the
requirement
%
total_time=4*delay;
k=1;
loc=0;
for t=0:total_time/10000:total_time
if(t>=delay)
signal(k)=1;
else
signal(k)=0;
end
time(k)=t;
k=k+1;
end
%%
plot(time,signal,'r','LineWidth',1.25)
grid on
xlabel('Time(s)')
ylabel('Amplitude')
%%
C)
%%
clc;
clear all;
close all;
%
delay=1;% Set the delay variable according to the
requirement
%
total_time=4*delay;
k=1;
loc=0;
for t=0:total_time/10000:total_time
if(t>=delay)
signal(k)=t-delay;
else
signal(k)=0;
end
time(k)=t;
k=k+1;
end
%%
plot(time,signal,'r','LineWidth',1.25)
grid on
xlabel('Time(s)')
ylabel('Amplitude')
%%
Part A: Write a generic Matlab code that generates delayed (shifted) Unit Impulse function. Part B:...
write a matlab script for a generic ramp function r(t) then plot for y=ramp(t,3,0). The variable t is in the interval-5<t<5 and increments in steps of 0.01 function y = ramp(t,m,ad). %t= time support, m= ramp slope, ad = signal advance(positive)/delay(negative)
Write MATLAB code to plot the following waveforms. Impulse approximation: δ(?) δ(? − ?) For ?, choose any value that makes sense. Unit steps: ?(?) ?(? − ?) ? ⋅ ?(? − ?) For ? and ?, choose any values that make sense
In your initial post, generate one of the following DISCRETE signals using a MATLAB function: The step signal The impulse signal The ramp signal The sinusoidal signal The decaying sinusoidal signal Let the signal you consider span the indices from –b to +b where b is your birth month. Calculate the total energy in the signal using MATLAB.
Matlab code for this problem. 1[35pl Write a user-defined MATLAB function that determines the unit vector in the direction of the line that connects two points (A and B) in space. For the func- tion name and arguments, use n = unitvec (A,B). The input to the function are two vectors A and B, each with the Cartesian coordinates of the corre- sponding point. The output is a vector with the components of the unit vector in the direction from...
Please write and include a matlab code for the following: Given the following differential equation 10?̈+ 20?̇ + 250? = ?(?) a. Plot response to f(t) = 200sin(4t) b. Plot response to a step f(t) = 200 that starts at t = 0 s and stops at t = 2s; note that the response goes past the 2 seconds of input. Part a.) I need matlab code to generate the plot for 10x''+20x'+250x=200sin(4t) Part b.) I need matlab code to...
Please provide the used MATLAB code. 2. Consider the closed-loop transfer function: T(s) a) Obtain the family of impulse responses for K-10, 200 and 500 b) Obtain the family of step responses for K-10, 200 and 500. c Obtain the family of ramp responses for K-10, 200 and 500. b) Co-plot each of the family of responses Explain using the DC-Gain for each of the K and the test signal. Is there any difference between s2+5s+K K's in terms of...
3. Problem 3 [Impulse). One of the most important digital signals is the so-called unit impulse sequence, which is a discrete time function whose sample is equal to zero for all values of the time index n except n = 0, where it has unity value, that is, Ji, n=0, 8[n] = 0, n+0. Page 6 (a) (2 points) Draw a graphical representation of the signal 8[n]. The horizontal axis should indicate the time-index value n = ..., -2,-1,0,1,2,... and...
MATLAB Code: ?MATLAB Code: Write a function that converts a given letter grade it will print its equivalence in numerical scale. For example if the user enters A, then your function should print a message stating that the grade must be between 90 and 100. B is between 80 and 89, etc. Everything under 60 is F. Use the switch-case function. Use fprintf to display the results on the screen.
in matlab (a)Write a function to generate n random integers between -b and b. (b) Using the function you wrote in (a) generate 50 random numbers in a vector A where b = 100; (c) This array A will contain both negative, positive and possibly zero entries. Write a MATLAB script to compute the percentage of positive, negative and zero entries in the array.
write a matlab code Write a MATLAB function to check the stability of a digital filter described by its coefficients. Syntax: stable (b, a); where b and a are the system's forward and backward coefficient. Hint: The roots() function might be useful. Returned value: None. Operation: Displays either 'Stable' or 'Not Stable' message and plots the z-plane. Test with Case#1: y(n)= 2x (n) +x (n-1) +0.4y (n-1) - 0.6y (n-2) Case#2: y(n)= x(n) +0.5x (n-1) +2x (n-2)- y(n-1) +y (n-2)...