f = 
Common factor
古いコメントを表示
Is there a function to make it find a common factor in an expression with symbolic variables?
For example:
ab+ac--(matlab command)--->a(b+c)
Thanks
回答 (1 件)
Andrei Bobrov
2011 年 9 月 29 日
help factor
syms a b c
factor(a*c + b*c)
6 件のコメント
cyberdyne
2011 年 9 月 29 日
Walter Roberson
2011 年 9 月 30 日
Did you happen to define a new factor.m ? Try
which factor
cyberdyne
2011 年 10 月 3 日
Walter Roberson
2011 年 10 月 3 日
I haven't heard of that one before. Does that include if the editor is up but showing no files at all ?
Zoya Saevna
2021 年 2 月 3 日
You shouldn't be kidding!
I know this part of the discussion is kind of old, but that error message cyberdyne quoted is likely to occur if for example the user were to store the output of the call to the factor function to a variable named factor in the Command Window. [Though it appears the text of the error message may have changed in the decade+ since the original message.]
syms a b c
f = a*b+a*c
factor = factor(f) % This first call works
z = factor(f) % This second one does not, since factor is now a variable
カテゴリ
ヘルプ センター および File Exchange で File Operations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!