Asked by David Durost
on 22 Aug 2019

Hello, I new to Matlab and I need help with this one problem.

"Find a MATLAB built in function that is used to find the lowest common denominator of fractions. Then use that function to show that the lowest common denominator of (hint, your input and solution will only contain one denominator values.'

Answer by Walter Roberson
on 23 Aug 2019 at 16:28

[n1, d1] = rat(1/4);

[n2, d2] = rat(1/10);

com = lcm(d1, d2);

Now that you have the least common multple of the denominators, you can calculate the equivalent fractions. The code is quite easy, but I will not provide it as you are obviously working on an assignment.

Sign in to comment.

Answer by David Durost
on 23 Aug 2019 at 16:43

Star Strider
on 23 Aug 2019 at 16:51

com=1cm(d1,d2);

↑

Walter Roberson
on 23 Aug 2019 at 17:36

Walter Roberson
on 23 Aug 2019 at 17:42

Be sure to distinguish between 'l' (lower-case L) and '1' (digit for the number One)

Sign in to comment.

Opportunities for recent engineering grads.

Apply Today
## 4 Comments

## Star Strider (view profile)

## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/477260-find-a-matlab-built-in-function-that-is-used-to-find-the-lowest-common-denominator-of-fractions#comment_738167

## David Durost (view profile)

## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/477260-find-a-matlab-built-in-function-that-is-used-to-find-the-lowest-common-denominator-of-fractions#comment_738168

## Walter Roberson (view profile)

## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/477260-find-a-matlab-built-in-function-that-is-used-to-find-the-lowest-common-denominator-of-fractions#comment_738184

## David Durost (view profile)

## Direct link to this comment

https://fr.mathworks.com/matlabcentral/answers/477260-find-a-matlab-built-in-function-that-is-used-to-find-the-lowest-common-denominator-of-fractions#comment_738341

Sign in to comment.