log2(x)

조회 수: 8 (최근 30일)
nastya nastya
nastya nastya 2020년 5월 24일
댓글: Gautam 2020년 5월 24일
Здравствуйте, помогите пожалуйста исправить ошибку.
Пишу функцию:
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개)

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by