t = -10:0.01:10;
f = inline('4.*hardlim(t+4)- postlin(t+4)+2.*postlin(t)- postlin(t-2)-2.*hardlim(t-2)', 't');
subplot(2,2,1);
plot(t, f(t));
subplot(2,2,2);
plot(t, f(2.*t));
subplot(2,2,3);
plot(t, f(t/1.5));
subplot(2,2,4);
plot(t, f(-t+3));
--------------------------------------------(error)-------------------------------
Error using inlineeval (line 14)
Error in inline expression ==> 4.*hardlim(t+4)- postlin(t+4)+2.*postlin(t)- postlin(t-2)-2.*hardlim(t-2)
Undefined function 'postlin' for input arguments of type 'double'.
Error in inline/subsref (line 23)
INLINE_OUT_ = inlineeval(INLINE_INPUTS_, INLINE_OBJ_.inputExpr, INLINE_OBJ_.expr);
Error in Untitled (line 14)
plot(t, f(-t+3));

 採用された回答

VBBV
VBBV 2021 年 10 月 25 日
t = -10:0.01:10;
f = inline('4*hardlim(t+4)-poslin(t+4)+2*poslin(t)-poslin(t-2)-2*hardlim(t-2)', 't')
f = Inline function: f(t) = 4*hardlim(t+4)-poslin(t+4)+2*poslin(t)-poslin(t-2)-2*hardlim(t-2)
subplot(2,2,1);
plot(t, f(t));
subplot(2,2,2);
plot(t, f(2.*t));
subplot(2,2,3);
plot(t, f(t/1.5));
subplot(2,2,4);
plot(t, f(-t+3));
You have a typo error for the function postlin instead of poslin. see the ref below

2 件のコメント

Abdallah Almughrabi
Abdallah Almughrabi 2021 年 10 月 25 日
omg thank you so much sir

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で PHY Components についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by