필터 지우기
필터 지우기

How to enter a function into MATLAB

조회 수: 1 (최근 30일)
Nicholas Deosaran
Nicholas Deosaran 2020년 9월 17일
댓글: Walter Roberson 2020년 9월 17일
Hello good day,
I am having issues on how to enter this equation into MATLAB.
I have it as
H/2 * cos(k*x)*cos(sigma*t)
but getting a different answer from my calculator
Thank you

답변 (1개)

Steven Lord
Steven Lord 2020년 9월 17일
Is your calculator computing the cosine of angles in degrees (which in MATLAB is the cosd function) or in radians (cos)?
  댓글 수: 2
Nicholas Deosaran
Nicholas Deosaran 2020년 9월 17일
I did it in radians and degrees and got different answers.
Am I tryping out the code corretly in MATLAB?
I don't know if I need to put the .* in the function.
Walter Roberson
Walter Roberson 2020년 9월 17일
If your inputs are all scalars then you can use either * or .*
If your inputs are not scalars, then you need .*

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by