Using Two Expressions together in factor()

1 visualización (últimos 30 días)
Ehsan Wadood
Ehsan Wadood el 2 de Mzo. de 2021
Comentada: Ehsan Wadood el 2 de Mzo. de 2021
Could anyon ehelp em with this as I am getting the below mentioned error while using two expressions together in the factor() function. Thanks
syms x y
factor([x^2-y^2,x^3+y^3])
Error using sym/factor (line 51)
First argument must be scalar.
  2 comentarios
KSSV
KSSV el 2 de Mzo. de 2021
The purpose of factor is different. https://in.mathworks.com/help/matlab/ref/factor.html
What you expect?
Ehsan Wadood
Ehsan Wadood el 2 de Mzo. de 2021
Thank you for your response however I expect an output, like this:
[ (x - y)*(x + y), (x + y)*(x^2 - x*y + y^2)]

Iniciar sesión para comentar.

Respuesta aceptada

Walter Roberson
Walter Roberson el 2 de Mzo. de 2021
syms x y
f = arrayfun(@factor, [x^2-y^2,x^3+y^3], 'uniform', 0);
vertcat(f{:})
ans = 

Más respuestas (0)

Categorías

Más información sobre Formula Manipulation and Simplification en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by