(question)How does the arguments syntax apply multiple optional type restrictions to one of the input arguments?
조회 수: 2 (최근 30일)
이전 댓글 표시
For example, I need to restrict the type of the input argument inImage to "uint8" or "logical" or "double" for the following signature function How do I do this ?
function out = myFcn(inImage)
arguments
inImage uint8 % uint8|| logical|| double
end
end
It seems that the type restriction can only be one, I tried to write uint8|| logical|| double like this, but it is not syntactically correct!
댓글 수: 0
채택된 답변
Anton Kogios
2023년 2월 22일
function out = myFcn(inImage)
mustBeA(inImage,["uint8","logical","double"])
end
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Whos에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!