How can I overcome the error "variable admit must be of data type logical instead of double"..I have to return logical values true or false using the function below.what is wrong with this?
조회 수: 9 (최근 30일)
이전 댓글 표시
function admit=eligible(v,q)
avg=(v+q)/2;
if avg>=92 ...%%
&& v>88 ... %%
&& q>88 %%
admit=1;
else
admit=0;
end
채택된 답변
Fangjun Jiang
2020년 5월 15일
The error message must have come from somewhere else, not from this function. Here, nothing is wrong except that the data type of "admit" seems not to comply with the required "logical" data type required by somewhere else.
You can use admit=ture, admit=false. "true" and "false" are defined in MATLAB.
댓글 수: 2
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Performance and Memory에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!