SHARE
TWEET

GotStuck

a guest Nov 19th, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. %%
  2. clc
  3. clear all
  4. close all
  5.  
  6. prompt1 = 'H(z) Numerator Maximum Order?!:';
  7. prompt2 = 'H(z) Denominator Maximum Order?!:';
  8. prompt3 = 'H(z) Numerator Coefficients?!:';
  9. prompt4 = 'H(z) Denominator Coefficients?!:';
  10. prompt5 = 'x(n):';
  11.  
  12. Lni = input(prompt1) + 1;
  13. Ldi = input(prompt2) + 1;
  14. Ni = [];
  15. Di = [];
  16. n = 1:1000;
  17.  
  18.  
  19. %Filling in the Numerator and Denominator Vectors
  20. for i=Lni:-1:1
  21.     u = input(prompt3);
  22.     Ni = [Ni u];
  23. end
  24.  
  25. for ii=Ldi:-1:1
  26.     v = input(prompt4);
  27.     Di = [Di v];
  28. end
  29.  
  30. %Getting x(n) from the user
  31. x = input(prompt5);
  32.  
  33.  
  34. %%
  35. %Getting Transient response
  36. isys = tf(Ni, Di);
  37. step(isys);
  38. lsim(isys, x,n);
  39.  
  40. %Getting X(z)
  41. % X = ztrans(x);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top