How to show TF function in GUI text box
4 ビュー (過去 30 日間)
古いコメントを表示
s = tf('s');
Gc =(s+1/T)/(s+1/(beta*T));
set(handles.TF,'string',Gc);
it showing some error
0 件のコメント
採用された回答
Walter Roberson
2021 年 8 月 7 日
s = tf('s');
T = randi([2 20])
beta = rand()
Gc =(s+1/T)/(s+1/(beta*T));
then
Gcstr = "(" + strtrim(poly2str(Gc.num{1}, 's')) + ")/(" + strtrim(poly2str(Gc.den{1}, 's')) + ")"
If you have the Symbolic Toolbox you could also do
Gcstr = string(vpa(poly2sym(Gc.num, sym('s')) / poly2sym(Gc.den, sym('s')),5))
After you have Gcstr created you can set the String property of your field to Gcstr .
0 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!