How to evaluate integral with given constant ?

syms x; f = 'h*x'; h =3; int(sym(f))
My code gives (h*x^2)/2
But I want it to evaluate it for h = 3 and then print the answer

 採用された回答

Stephan
Stephan 2018 年 5 月 21 日

1 投票

Hi,
change the order of your commands
syms x;
h = 3;
f = h*x;
int(sym(f))
gives:
ans =
(3*x^2)/2
Best regards
Stephan

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeSymbolic Math Toolbox についてさらに検索

タグ

質問済み:

2018 年 5 月 21 日

回答済み:

2018 年 5 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by