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!