factor2.m

factor2(n) returns the prime factorization of n as a k by 2 matrix.

Vous suivez désormais cette soumission

Given a nonnegative integer n, factor2(n) returns the prime factorization of n as a 2 by k matrix, with the k distinct prime factors in the left column and exponents in the right column.

Citation pour cette source

David Terr (2026). factor2.m (https://fr.mathworks.com/matlabcentral/fileexchange/4966-factor2-m), MATLAB Central File Exchange. Extrait(e) le .

Catégories

En savoir plus sur Discrete Math dans Help Center et MATLAB Answers

Informations générales

Compatibilité avec les versions de MATLAB

  • Compatible avec toutes les versions

Plateformes compatibles

  • Windows
  • macOS
  • Linux
Version Publié le Notes de version Action
1.0.0.0

I modified this program so that it sorts the prime factors by columns instead of by rows, allowing for more convenience, especially with large numbers. I also modified it so it now works with negative numbers as well.