Function e^x - e^-x / e^x + e^-x

조회 수: 8 (최근 30일)
Thomas Kozinski
Thomas Kozinski 2021년 3월 10일
편집: Matt J 2021년 3월 10일
Hello, I need help with the function. Its task is to determine the values of the function at each point of the linear space and then draw this function using the plot function.
I have a problem already in the first point, I wanted to calculate the values using:
exp (x) -exp (-x) / exp (x) + exp (-x)
and gets error: Undefined function or variable 'x'. How should I solve this problem?
  댓글 수: 1
Thomas Kozinski
Thomas Kozinski 2021년 3월 10일
Thank you in advance for your help!

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

채택된 답변

Matt J
Matt J 2021년 3월 10일
편집: Matt J 2021년 3월 10일
For example,
x=linspace(-5,5,100);
plot(x,tanh(x))
  댓글 수: 2
Thomas Kozinski
Thomas Kozinski 2021년 3월 10일
so should I follow these instructions, it would be correct?
x=linspace(-5,5,100);
exp (x) -exp (-x) / exp (x) + exp (-x)
plot(x,tanh(x))
Matt J
Matt J 2021년 3월 10일
편집: Matt J 2021년 3월 10일
It will not throw an error, but I do not know why you have added that 2nd line. The code I gave does exactly what you said you wanted.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by