Find Closest Factorization

Given y, finds x1 and x2 such that x1*x2 = y and |x1-x2| is minimized.

Al momento, stai seguendo questo contributo

Given an input integer, this simple function returns two of its factors (also integers) such that the product of these factors equals the input and the factors are as close as possible.
Non-integer input will be rounded to the nearest integer.

Examples:
FindClosestFactorization(12) = [3 4]
FindClosestFactorization(39) = [3 13]
FindClosestFactorization(4) = [2 2]
FindClosestFactorization(7) = [1 7]

Cita come

Luke Gane (2026). Find Closest Factorization (https://it.mathworks.com/matlabcentral/fileexchange/57255-find-closest-factorization), MATLAB Central File Exchange. Recuperato .

Categorie

Scopri di più su Linear Algebra in Help Center e MATLAB Answers

Informazioni generali

Compatibilità della release di MATLAB

  • Compatibile con qualsiasi release

Compatibilità della piattaforma

  • Windows
  • macOS
  • Linux
Versione Pubblicato Note della release Action
1.0.0.0