I am not sure why my function is undefined for input arguments double.
조회 수: 1 (최근 30일)
이전 댓글 표시
% Enter the commands for your function here.
x = random_number
function [check_range] = numberChecker(random_number, check_range)
if (random_number < 10 & random_number > 0)
check_range = 1
else
check_range =-1
end
end
댓글 수: 0
채택된 답변
Chunru
2022년 9월 26일
x = rand([-20 20]); % generate random number in range [-20 20]
% call the function
% output function_name input_argument
check = numberChecker( x )
function [check_range] = numberChecker(random_number)
if (random_number < 10 & random_number > 0)
check_range = 1;
else
check_range =-1;
end
end
댓글 수: 0
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!