Hi, I want to simply convert a fraction into a float. When I checked with the help, it seems really simple. To convert 2/5 into a float, it seems like I just need to type float(2/5). But, when I do that, I have for response :Error using float (line 46) The input argument to float was not a supported type. The only recognized input character vectors are 'single' and 'double'. The input type was 'double'. Can someone explain me that?
No. There is no need to use float.
x = 2/5 x = 0.4
whos x Name Size Bytes Class Attributes
x 1x1 8 double
x is automatically a floating point number, of class double.