numden

Numerator and denominator of a rational expression.

Category: Mathematics > Formula Manipulation and Simplification

Syntax

[n, d] = numden(A)

Returns the numerator and denominator after combining A into one fraction in lowest terms.

Description

numden first brings the terms to a common denominator and cancels common factors. For numeric input, the value is converted to a rational number first, so numden(0.75) gives 3 and 4.

Input arguments

A
Symbolic expression, array, or numeric value.

Output arguments

n
Numerator.
d
Denominator.

Example

Rational expression and number

syms x
[n, d] = numden(x/3 + 1/x)
[n2, d2] = numden(0.75)
Output
n = x^2 + 3
d = 3*x
n2 = 3
d2 = 4

See also

rat partfrac simplifyFraction simplify factor