Hypobolic Tangent Function Question

조회 수: 1 (최근 30일)
Allen
Allen 2013년 10월 13일
댓글: Youssef Khmou 2013년 10월 13일
I am a beginner with Matlab. I am trying to create a .m file that will plot a function for me. There are other parts to what I want to plot, but my problem is apparently something with plotting a hyperbolic tangent function that is in the denominator of a fraction. Here is a simplified version of my script:
y=-3:0.01:3; f=1/tanh(y) plot(y,f)
I keep getting an error on the second line. When I define other functions for "f" I get a plot, but I can't get the hyperbolic tangent function in the denominator to plot. Could someone please tell me what is wrong with my script?
Thanks, Allen

답변 (1개)

Youssef  Khmou
Youssef Khmou 2013년 10월 13일
its easy to fix the error, vector computation is column wise :
y=-3:0.01:3; f=1./tanh(y); plot(y,f)
  댓글 수: 2
Allen
Allen 2013년 10월 13일
That fixed my problem! Thank you!
Youssef  Khmou
Youssef Khmou 2013년 10월 13일
if the problem is completely solved, you accept the answer .

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

카테고리

Help CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by