How do I define the limits of a discrete model? Why do I receive this error for every t and sht variables?

1 回表示 (過去 30 日間)
How do I define the limits of a discrete model? Why do I receive this error for every t and sht variables?
t= 0:0.01:10;
x=tf([1],[1 1]);
sht=0.5;
cd=c2d(x,sht,'zoh')
Transfer function: 0.3935 ---------- z - 0.6065
Sampling time (seconds): 0.5 step(cd,t)
??? Error using ==> DynamicSystem.step at 84 When specifying a time vector for time response simulations, the time step match the sampling time of discrete-time models.
  3 件のコメント
Fangjun Jiang
Fangjun Jiang 2011 年 6 月 3 日
Me too. Definitely need to avoid that.
sadel
sadel 2011 年 6 月 3 日
lol Are you talking about 'sht'? Sample Hold Time

サインインしてコメントする。

採用された回答

Fangjun Jiang
Fangjun Jiang 2011 年 6 月 3 日
Your "t" indicates 0.01 as the sample time, but your c2d(x,sht,'zoh') indicate 0.5 as the sample time. You need to make them the same and it will work.
  3 件のコメント
Fangjun Jiang
Fangjun Jiang 2011 年 6 月 3 日
You are doing a continues transfer function to discrete transfer function conversion, which is sample time dependent. It doesn't make sense to run your discrete transfer function in a different sample time than where it comes from. You can run step(x,0:0.01:10) or step(x,0:0.001:10) without any problem. You can also run a discrete transfer function at different sample time if that discrete transfer function is defined directly (like a simple z delay). Don't mix the two together.
type cd in Matlab command window, you'll see the discrete transfer function and it has a sample time associated with it. BTW, cd is a Matlab command. You'd better avoid using it as a variable.
sadel
sadel 2011 年 6 月 3 日
Ok, thank you very much for your answer!!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

タグ

タグが未入力です。

Community Treasure Hunt

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

Start Hunting!

Translated by