Is there something wrong with this function?
이전 댓글 표시
It is supposed to figure out if the number is whole or not. if not it rounds down, if it is it squares.
function [remainder]=data_modifier(data1)
remainder=rem(data1,1)
if remainder==0
sqrt(data1)
else
floor(data1)
end
end
댓글 수: 2
Kevin Chng
2018년 10월 23일
편집: Kevin Chng
2018년 10월 23일
No error. Why?
However, change your output of function, i guess remainder is not the output you wanted.
madhan ravi
2018년 10월 23일
No it’s not correct if the input is float ,it fails
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!