Advertisement
Ostu

Untitled

May 12th, 2021
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.31 KB | None | 0 0
  1. %% Sygnały
  2. x=[1 2 -1 3 -5]
  3. y=[-2 2 10 -15 32 -41 26 -15]
  4. %% Elementy
  5. N=numel(x)
  6. M=numel(y)
  7. H = M-N+1
  8. %% Równanie
  9.  h=0*(1:H);
  10. for n=1:H
  11.  if n==1
  12.     h(n)=y(1)/x(1);
  13.  else
  14.  rownanie_wew=0;
  15.  for k=1:n-1
  16.  rownanie_wew = rownanie_wew + h(k)*x(n+1-k);
  17.  end
  18.  h(n)=(1/x(1))*(y(n)-rownanie_wew)
  19.  end
  20. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement