Cannot use any trigonometric functions

9 ビュー (過去 30 日間)
현욱 강
현욱 강 2021 年 8 月 22 日
回答済み: Walter Roberson 2021 年 8 月 22 日
As title said, I cannot use any trigonometric functions,
it outputs error message.
>> x=0:pi/100:2*pi;
>> y1=sin(2*x);
Execution of script sin as a function is not supported:
C:\Program Files\MATLAB\R2021a\toolbox\matlab\elfun\sin.m

回答 (2 件)

Walter Roberson
Walter Roberson 2021 年 8 月 22 日
At the command prompt try
restoredefaultpath; rehash toolboxcache
The file mentioned, "C:\Program Files\MATLAB\R2021a\toolbox\matlab\elfun\sin.m", does exist, but it is just a text file that is used to extract documentation from. MATLAB should have instead used "C:\Program Files\MATLAB\R2021a\toolbox\matlab\elfun\@double\sin.m"

Star Strider
Star Strider 2021 年 8 月 22 日
Execution of script sin as a function is not supported:
You have a script (not a functions) named ‘sin.m’.
Rename it to something that makes sense in the context of your code and does not conflict with any MATLAB functions (this is called ‘overshadowing’), and the problem should go away.
.

カテゴリ

Help Center および File ExchangeEntering Commands についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by