How to collect a fraction in a certain equation?

2 vues (au cours des 30 derniers jours)
Fahmy Shandy
Fahmy Shandy le 12 Déc 2019
Commenté : Fahmy Shandy le 12 Déc 2019
Suppose i have this equation :
>> syms a b c d e
>> f=(a/3)+(b/3)+(c/3)+(d/3)+(e/3)
f =
1/3*a+1/3*b+1/3*c+1/3*d+1/3*e
And i need some command to collect term. And i wish it will displays :
f =
(1/3)*(a+b+c+d+e)
Is it possible to do this? How?
Thanks in advance!

Réponse acceptée

Chuguang Pan
Chuguang Pan le 12 Déc 2019
Hi Fahmy.
I try the matlab function factor, but it get the result as following.
syms a b c d e
f=(a/3)+(b/3)+(c/3)+(d/3)+(e/3);
F=factor(f)
F=[1/3,a+b+c+d+e]. maybe exist another method.
  1 commentaire
Fahmy Shandy
Fahmy Shandy le 12 Déc 2019
Anyway, it's still great. Thanks.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by