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 Exchange에서 Symbolic 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