Question

I am plotting a system in matlab using the command lsim(sys,u,t,x0) and trying to define my...

I am plotting a system in matlab using the command lsim(sys,u,t,x0) and trying to define my input signal as u(t)^(-2t). My question is how do I define this input signal in matlab. The matlab guides show that you use u=gensig() but beyond that I cannot understand how to define my input signal in u=gensig().

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

CODE:

clc
close all

% here gensig() is for standard signals
% like sin square and pulse

t = 0:0.001:5;
% define input
u = (1*(t>=0)).^(-2*t);

% deifne system
sys =2/(s+3);
% initial condition
xo = 2;
% output
y = lsim(sys,u,t,xo);
plot(t,y)
hold on
plot(t,u)
ylim([0 1.2])
legend('y(t)','x(t)')
grid on

RESULT:

Add a comment
Know the answer?
Add Answer to:
I am plotting a system in matlab using the command lsim(sys,u,t,x0) and trying to define my...
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
  • Question 3) Given a system with an impulse response of: h(t) = te-2t(U(t)-U(t-4)). Use MATLAB to ...

    Question 3) Given a system with an impulse response of: h(t) = te-2t(U(t)-U(t-4)). Use MATLAB to compute the output of the system with an input of: x(t)-3(U(t -2)-U(t - 5) Question 3) Given a system with an impulse response of: h(t) = te-2t(U(t)-U(t-4)). Use MATLAB to compute the output of the system with an input of: x(t)-3(U(t -2)-U(t - 5)

  • Matlab help 1) Given the functions x1()= tu()-tuft-1) and X2(t)=10e-5,11(), do the following: 1. Plotx,(t) and x2(0) using MATLAB 2. Use MATLAB to find and plot x(0=x:@*.x2(t), where * denotes co...

    Matlab help 1) Given the functions x1()= tu()-tuft-1) and X2(t)=10e-5,11(), do the following: 1. Plotx,(t) and x2(0) using MATLAB 2. Use MATLAB to find and plot x(0=x:@*.x2(t), where * denotes convolution. 3. Find x(t)=x;()*X2(1) by hand using Laplace transforms. 4. Plot the result of part 3 in MATLAB and compare it to that found in part 2. 2) Given the transfer function shown below, do the following: 1. Find the system's impulse response and plot it using MATLAB 2. Repeat...

  • I am trying to add a string command to my code. what am i doing wrong?...

    I am trying to add a string command to my code. what am i doing wrong? #define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES #include <stdio.h> #include <string.h> #include <math.h> int main(void) {    int i, j;    int rowA, colA, rowB, colB;    int A[10][10], B[10][10];    int sum[10][10];    char str1[10];    printf("This is a matrix calculator\n");    //read in size from user MATRIX A    printf("Enter in matrix A....\n");    printf("\t#row = ");    scanf("%d", &rowA);    printf("\t#col = ");   ...

  • This is for Controls Systems class. Please solve everything, and show all work and correct answers...

    This is for Controls Systems class. Please solve everything, and show all work and correct answers and matlab codes for positive rating. A - C, E - F do by hand. D, G-I do in Matlab as instructions direct. (Show codes and plots for matlab solutions too!), show the code and plots obtained for positive rating. Provided below is the Handout 7 equations that are needed for this problem for use. 1. The state space model of a system is...

  • I would like to have a better understanding of how to do Fourier transformations on Matlab....

    I would like to have a better understanding of how to do Fourier transformations on Matlab. If this is possible. Please show me how to: 1. have Matlab FIND the Fourier transformation of the two functions above. They do not have to be in the same program or anything. I just want to understand the syntax and semantics better. 2. THEN plot the Fourier transform that you found VIA MATLAB. The main thing that I am trying to do is...

  • Hello, I am having trouble with a problem in my C language class. I am trying...

    Hello, I am having trouble with a problem in my C language class. I am trying to make a program with the following requirements: 1. Use #define to define MAX_SIZE1 as 20, and MAX_SIZE2 as 10 2. Use typedef to define the following struct type: struct {     char name[MAX_SIZE1];     int scores[MAX_SIZE2]; } 3. The program accepts from the command line an integer n (<= 30) as the number of students in the class. You may assume that the...

  • In trying to apply my knowledge in the real world, I am trying to create a...

    In trying to apply my knowledge in the real world, I am trying to create a realistic retirement schedule. However, I am running into difficulties using both a financial calculator as well as our equations from class in doing this. I am trying to do the following: plan a retirement schedule between the ages of 25 and 70, in which I would deposit 20% of my income each year. The income starts at 80,000 with an annual growth rate of...

  • Context of my question: I am reading C#. Trying to understand Static keyword. I understand that...

    Context of my question: I am reading C#. Trying to understand Static keyword. I understand that when Static is applied to a member of a class, it can only be modified by the class and not the class object references. I will take an example here. public class BluePrint {    public static string BluePrintCreatorName; } If I need to know the BluePrintCreator's Name, I can call BluePrint.BluePrintCreatorName; But if a house that is created from the blueprint wants to...

  • I need help with this MATLAB exercise. The given system is y[n] - (3/10)y[n-1] - (1/10)y[n-2]...

    I need help with this MATLAB exercise. The given system is y[n] - (3/10)y[n-1] - (1/10)y[n-2] = 2x[n] The input x[n] is 2cos(2*pi*n/6)(u[n] - u[n-10]) Don't have to answer part 2 of the question. Zero-state response of a system can be found by using convolution of the input signal and unit impulse response: Use conv command from MATLAB to compute the zero-state response of the system defined in part B to the input x[n] in part C. 1. 2. 3....

  • Matlab help 1) Given the functions x1()= tu()-tuft-1) and X2(t)=10e-5,11(), do the following: 1. Plotx,(t) and...

    Matlab help 1) Given the functions x1()= tu()-tuft-1) and X2(t)=10e-5,11(), do the following: 1. Plotx,(t) and x2(0) using MATLAB 2. Use MATLAB to find and plot x(0=x:@*.x2(t), where * denotes convolution. 3. Find x(t)=x;()*X2(1) by hand using Laplace transforms. 4. Plot the result of part 3 in MATLAB and compare it to that found in part 2. 2) Given the transfer function shown below, do the following: 1. Find the system's impulse response and plot it using MATLAB 2. Repeat...

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