Is this the correct way to factor out denominator and nominator of this complex expression?
3 ビュー (過去 30 日間)
古いコメントを表示
syms x
[N,D]= numden((x^5-2*x^4-18*x^3+4*x^2+49*x+30)/(3*x^2+23*x+36))
F1= factor(N)
F2= factor(D)
I have attached my code above and original question below. Also, I wasn't quite sure about the phrase "Print your results to the Command Window".

1 件のコメント
Paul
2023 年 9 月 14 日
Just want to point out that the expression entered into numden doesn't match the expression in the problem statement.
回答 (1 件)
Walter Roberson
2023 年 9 月 14 日
When you have symbolic results, there are several different ways you can display them to the command window:
- you can assign them to a variable in a statement that does not end in a semi-colon. The results will be automatically displayed as is shown in your Question
- you can assign them to a variable in a statement that does end in a semi-colon. Then, at some later point, you can disp() the variable
- you can char() a symbolic expression and use disp() or fprintf() with '%s' format to display the result. Or you can string() and disp() or fprintf() with '%s'
- you can latex() a symbolic expression and text() it onto an axes with 'interpreter', 'latex'
- you can pretty() a symbolic expression and display the result the command window; the result will be partly formatted
Note:
If you are using LiveScript and displaying a symbolic expression then the result will be nicely formatted, but if you char() or string() first or you display to the command window, then it will not be nicely formatted
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Symbolic Variables, Expressions, Functions, and Preferences についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!