Здравствуйте, помогите пожалуйста исправить ошибку.
Пишу функцию:
function [F] = log2(x)
F = log(x)/log(2);
end
Но мне выдает ошибку:
Not enough input arguments.
Error in log2 (line 2)
F = log(x)/log(2);

2 件のコメント

nastya nastya
nastya nastya 2020 年 5 月 24 日
function [F] = log2(x)
F = log(x)/log(2);
end
Gautam
Gautam 2020 年 5 月 24 日
After writing your function save the file. Then in MATLAB command prompt try
>> value = log2(10);
PS: You dont have to create this function. Since log2 is a built-in MATLAB function https://www.mathworks.com/help/matlab/ref/log2.html

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeIntroduction to Installation and Licensing についてさらに検索

タグ

質問済み:

2020 年 5 月 24 日

コメント済み:

2020 年 5 月 24 日

Community Treasure Hunt

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

Start Hunting!

Translated by