Numerical function invalid expression
1 回表示 (過去 30 日間)
古いコメントを表示
I want to defind a function numerically. The function is ((e^2x)*tan(x))/x^3).
I'm using h=@(x)exp(2x).*tan(x)./x.^3 to defind it but it says invalid expression. Please help and thanks in advance.
0 件のコメント
採用された回答
the cyclist
2021 年 8 月 2 日
編集済み: the cyclist
2021 年 8 月 2 日
You need the explicit multiplication sign 2*x:
h=@(x)exp(2*x).*tan(x)./x.^3
You might also want to put in some parentheses instead of relying on the order of operations, to be certain the expression is evaluated in the order you expect.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Environment and Settings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!