is n>=0.Inline function is not working properly
2 ビュー (過去 30 日間)
古いコメントを表示
So I am trying to make a stem graph and the text book uses inline to create a function for discrete time function but I keep having errors using it. The function is
i just want to know for either an alternative or why the inline function isnt working with my code. Snippet of code not working:
i just want to know for either an alternative or why the inline function isnt working with my code. Snippet of code not working: n = -10:10;
f = inline('e^(-n/5).*cos(pi*n/5).*(n>=0)','n');
stem(n,f(n),'k');
0 件のコメント
採用された回答
Guillaume
2019 年 10 月 25 日
f = @(n) exp(-n/5) .* cos(pi*n/5) .* (n>=0);
assuming
is n>=0.
is n>=0.0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Function Creation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!