Is there something wrong with this function?
Ältere Kommentare anzeigen
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 Kommentare
Kevin Chng
am 23 Okt. 2018
Bearbeitet: Kevin Chng
am 23 Okt. 2018
No error. Why?
However, change your output of function, i guess remainder is not the output you wanted.
madhan ravi
am 23 Okt. 2018
No it’s not correct if the input is float ,it fails
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Logical finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!