Control System Toolbox の 伝達関数オブジェクトを Symbolic Math Toolbox のシンボリックオブジェクトに変換することはできますか?
조회 수: 1 (최근 30일)
이전 댓글 표시
以下同様に伝達関数 "t" を定義しています。
t = tf(1:3,4:6)
Transfer function:
s^2 + 2 s + 3
---------------
4 s^2 + 5 s + 6
得られた伝達関数オブジェクトをシンボリックオブジェクトに変換して CCODE、FORTRAN 及び LATEX 関数を適用したいと考えています。方法を教えてください。
채택된 답변
MathWorks Support Team
2013년 5월 1일
以下同様に伝達関数オブジェクトをシンボリックオブジェクトに変換することが可能です。
t = tf(1:3,4:6);
[num,den] = tfdata(t);
syms s
t_sym = poly2sym(cell2mat(num),s)/poly2sym(cell2mat(den),s)
上記コードの実行結果が以下の通りです。
t_sym =
(s^2+2*s+3)/(4*s^2+5*s+6)
後段の処理で以下同様に t_sym オブジェクトに対して Symbolic Math Toolbox の関数 CCODE、FORTRAN または LATEX を利用します。
c = ccode(t_sym)
f = fortran(t_sym)
l = latex(t_sym)
以下の結果が表示されます。
c =
t0 = (s*s+2.0*s+3.0)/(4.0*s*s+5.0*s+6.0);
f =
t0 = (s**2+2*s+3)/(4*s**2+5*s+6)
l =
{\frac {{s}^{2}+2\,s+3}{4\,{s}^{2}+5\,s+6}}
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 変換에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!