>> n=-3:0.13; >> x=stepseq(0,-3,3); ??? Undefined function or method 'stepseq' for input arguments of type 'double'.
>> n=-5:5; >> x=impseq(-3,-5,5); ??? Undefined function or method 'impseq' for input arguments of type 'double'.
please assist on the above unsolved functions
Giannis

Antworten (3)

Charles Obare
Charles Obare am 5 Mär. 2021
Bearbeitet: Walter Roberson am 5 Mär. 2021

1 Stimme

save this from the text.
function [x,n] = stepseq(n0,n1,n2)
% Generates x(n) = u(n-n0); n1 <= n,n0 <= n2
% ------------------------------------------
% [x,n] = stepseq(n0,n1,n2)
%
if ((n0 < n1) | (n0 > n2) | (n1 > n2))
error('arguments must satisfy n1 <= n0 <= n2')
end
n = [n1:n2];
%x = [zeros(1,(n0-n1)), ones(1,(n2-n0+1))];
x = [(n-n0) >= 0];
_______________________________________________________________________Next file
function [x,n] = impseq(n0,n1,n2)
% Generates x(n) = delta(n-n0); n1 <= n,n0 <= n2
% ----------------------------------------------
% [x,n] = impseq(n0,n1,n2)
%
if ((n0 < n1) | (n0 > n2) | (n1 > n2))
error('arguments must satisfy n1 <= n0 <= n2')
end
n = [n1:n2];
%x = [zeros(1,(n0-n1)), 1, zeros(1,(n2-n0))];
x = [(n-n0) == 0];
Paulo Silva
Paulo Silva am 1 Aug. 2011

0 Stimmen

Both of those functions aren't avaiable from MATLAB instalation files, they are from some book or files, create them first or download them and put them in the current path or some other path that MATLAB knows about.
You can get those functions and the rest of them from: Digital Signal Processing Using MATLAB by John Proakis
Sean de Wolski
Sean de Wolski am 1 Aug. 2011

0 Stimmen

I've never heard of those functions before, nor are they on the file exchange.

3 Kommentare

Paulo Silva
Paulo Silva am 1 Aug. 2011
They are from a book about signal processing, you can easily get them using google :)
Sean de Wolski
Sean de Wolski am 1 Aug. 2011
Ahh
The G00g13 wins again.. Apparently they are on the FEX as well.
Paulo Silva
Paulo Silva am 1 Aug. 2011
I remembered the functions from one class I had last year, that book and files were great to understand signal processing.

Melden Sie sich an, um zu kommentieren.

Gefragt:

am 1 Aug. 2011

Bearbeitet:

am 5 Mär. 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by