variable usage in function tf

very new in matlab. I want to write a script where user will define K
e,g
num=[K 1];
den=[2 1];
sys= tf(num,den);
and later ask the value from user but says function tf can accept only numeric values

回答 (1 件)

Wayne King
Wayne King 2012 年 6 月 2 日

0 投票

Yes, the user will have to input some numeric value for K
K = input('Enter your coefficient\n');
num = [K 1];
den = [2 1];
sys = tf(num,den);
Can you be more specific about what you are trying to do? It helps if you actually show some MATLAB code. You seem to really be limiting the possible form of the numerator and denominator coefficients.

カテゴリ

ヘルプ センター および File ExchangeDynamic System Models についてさらに検索

タグ

質問済み:

2012 年 6 月 2 日

Community Treasure Hunt

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

Start Hunting!

Translated by