Здравствуйте, помогите пожалуйста исправить ошибку.
Пишу функцию:
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 Exchange에서 Introduction 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