why doesn't the function sigshift work when i use it for x(n) = 2x(n - 5) - 3x (n + 4).

5 ビュー (過去 30 日間)
Blasphemy
Blasphemy 2015 年 1 月 30 日
編集済み: dato datuashvili 2015 年 2 月 2 日
n = -2:10; x = [1:7,6:-1:1]; [x11,n11] = sigshift(r,n,5); [x12,n12] = sigshift(x,n,-4); [xl,nl] = sigadd(2*x11,n11,-3*x12,n12); stem(n1,x1); grid;
it shows: Undefined function 'sigshift' for input arguments of type 'double'.

回答 (2 件)

Niels
Niels 2015 年 1 月 30 日
Your function sigshift seems not to be a built-in function. Are you sure the function/directory it is located in is included in your work path?

dato datuashvili
dato datuashvili 2015 年 2 月 2 日
編集済み: dato datuashvili 2015 年 2 月 2 日
locate this code in the same directory
function [y,n] = sigshift(x,m,n0)
% implements y(n) = x(n-n0)
% -------------------------
% [y,n] = sigshift(x,m,n0)
%
n = m+n0; y = x;
in other word create script with name same as sigshift and locate this script in the same directory where variables are declared

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by