How to enter a function into MATLAB
조회 수: 2 (최근 30일)
이전 댓글 표시
Hello good day,
I am having issues on how to enter this equation into MATLAB.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/361918/image.png)
I have it as
H/2 * cos(k*x)*cos(sigma*t)
but getting a different answer from my calculator
Thank you
댓글 수: 0
답변 (1개)
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
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 .*
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!