Matlab says that the 'e' is undefined

Hi,
I trying to get an integral of a simple function F(x) = 3*x.^2 + e.^(2*x) and matlab won't let me enter the equation, so I am stuck with figuring out how to enter in the function F(x) into the system.
The question I am struggling on is, "compute the integral of the function F(x) using symbolic manipulation functionality", and I have no clue where to start on..
Please help me start off! Much appreciated if you guys could provide me with some commands as well.
Thank you!

답변 (2개)

Guillaume
Guillaume 2017년 7월 26일

3 개 추천

In matlab, and many languages, the exponential function is exp, not e.
F(x) = 3*x.^2 + exp(2*x)

댓글 수: 4

Sarah Park
Sarah Park 2017년 7월 26일
Hi! Thank you for your answer, I have tried that already and Matlab says this:
"Subscript indices must either be real positive integers or logicals"
Stephen23
Stephen23 2017년 7월 26일
편집: Stephen23 2017년 7월 26일
@Sarah Park: most likely you defined a variable named exp. Clear that variable.
Sarah Park
Sarah Park 2017년 7월 26일
편집: Stephen23 2017년 7월 26일
@stephen Cobeldick: Thank you for your answer! I just cleared everything in my workspace and entered the original x values
x1=cos(pi/6);
x2=cos(3*pi/6);
x3=cos(5*pi/6);
but now it says: "undefined function or variable 'x'". I don't know what to do..
Stephen23
Stephen23 2017년 7월 26일
편집: Stephen23 2017년 7월 26일
@Sarah Park: you show that you defined three variables named x1, x2, and x3, but apparently you do not define any variable named x.
"I don't know what to do.."
You need to define a variable before you can use in in any calculation or operation.

댓글을 달려면 로그인하십시오.

Torsten
Torsten 2017년 7월 26일

1 개 추천

See the examples under
https://de.mathworks.com/help/symbolic/int.html
Best wishes
Torsten.

댓글 수: 1

Sarah Park
Sarah Park 2017년 7월 26일
@Torsten: Thank you! I will look into it now :)

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

태그

질문:

2017년 7월 26일

댓글:

2017년 7월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by