Convert Fractions to Same Denominator (same_denominator)

version 2.0.2 (7.26 KB) by
Scales a set of fractions so they each have the same denominator.

Updated 28 Aug 2021

From GitHub

same_denominator Scales a set of fractions so they each have the same denominator.

Syntax

[num,gcd] = same_denominator(X)
[num,gcd] = same_denominator(X,'print')
same_denominator(X,'print')

Description

[num,gcd] = same_denominator(X) converts all the fractions in X so they have the same denominator. The resulting scaled numerators are returned in the array num, which is an array of the same size as X, and the greatest common divisor of the elements of X is returned as gcd.

[num,gcd] = same_denominator(X,'print') does the same as the above syntax, but also prints the new fractions.

same_denominator(X,'print') converts all the fractions in X so they have the same denominator and prints the results.

Examples

• See "EXAMPLES.mlx" or the "Examples" tab on the File Exchange page for examples.

Cite As

Tamas Kis (2022). Convert Fractions to Same Denominator (same_denominator) (https://github.com/tamaskis/same_denominator-MATLAB/releases/tag/v2.0.2), GitHub. Retrieved .

MATLAB Release Compatibility
Created with R2021a
Compatible with any release
Platform Compatibility
Windows macOS Linux