MATLAB Answers

0

How to show tf function to text box?

Asked by Hyun Ho Lee on 18 Sep 2019 at 4:11
Latest activity Commented on by Walter Roberson
on 19 Sep 2019 at 13:32
num = [str2num(num1) str2num(num2) str2num(num3)];
den = [str2num(den1) str2num(den2) str2num(den3)];
sys = tf(num,den)
set(handles.text1,num2str(sys)

  0 Comments

Sign in to comment.

Tags

1 Answer

Answer by Walter Roberson
on 18 Sep 2019 at 7:48

sys_char = evalc(sys);
sys_cell = splitlines(sys_char);
sys_cell = sys_cell(2:end-2); %some useless empty lines
set(handles.text1, 'Max', 2, 'FontName', 'mono', 'String', sys_cell);

  2 Comments

Hyun Ho Lee on 19 Sep 2019 at 4:10
thank you! but error occured..
message is "input of evalc is not string or vector of char"
Walter Roberson
on 19 Sep 2019 at 13:32
sys_char = evalc('sys');

Sign in to comment.