Hi,
Can someone figure out how to let poles, zeroes, gains all values show into message box? The format i've created doesn't show other values. This is for my project. Thanks!!
numerator = inputdlg('Enter the coefficients of the numerator of transfer function:','Numerator',[1 50]);
num = str2num(numerator{1});
denominator = inputdlg('Enter the coefficients of the denominator of transfer function:','Denominator',[1 50]);
den = str2num(denominator{1});
[z,p,k] = tf2zp(num,den);
poles = {p};
zeroes = {z};
gains = {k};
Gs = tf(num,den)
TF = evalc('Gs');
result = msgbox(sprintf(' %.4f + %.4fi',poles{:}),"Poles");

 채택된 답변

Star Strider
Star Strider 2021년 3월 11일

0 개 추천

Specify the real and imaginary parts of the poles (and later, zeros) and add a newline (\n) character:
result = msgbox(sprintf(' %.4f + %.4fi\n',[real(poles{:}) imag(poles{:})].'),"Poles");
This appears to display them correctly.

댓글 수: 2

Maria Sonon
Maria Sonon 2021년 3월 11일
you're a true MVP. thank youuu!! this means a lot this is my project at school
Star Strider
Star Strider 2021년 3월 11일
As always, my pleasure!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Structures에 대해 자세히 알아보기

질문:

2021년 3월 11일

댓글:

2021년 3월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by