decimal to fraction conversion
2,083 views (last 30 days)
I am given the number of women in an array in a new variable that equals 74. I am also given the total number of students in a new variable that equals to 144. I did the math on Matlab
the answer is .513889. How do i make this into fraction? I have tried to rat function but it gives me multiple answers so i am confused.
Roger Stafford on 22 Mar 2016
The 'rat' function returns with an output in the form of continued fractions. To see it as a single fraction, use "format rat".
MHN on 23 Mar 2016
or if you would like to have numbers
[num, dem] = rat(74./ 144);
Walter Roberson on 22 Mar 2016
[num, dem] = rat(totalWoman./ totalStudents);
The fraction is then num / dem .
The output of rat is different when there are two outputs than when there is only one.