Is this the correct way to factor out denominator and nominator of this complex expression?

3 ビュー (過去 30 日間)
HXO
HXO 2023 年 9 月 13 日
回答済み: Walter Roberson 2023 年 9 月 14 日
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))
N = 
D = 
F1= factor(N)
F1 = 
F2= factor(D)
F2 = 
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
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
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

カテゴリ

Help Center および File ExchangeSymbolic Variables, Expressions, Functions, and Preferences についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by