作者sleeeve (赴美留学的日子...)
看板MATLAB
标题[问题] step函数for回圈的一个问题
时间Tue Jan 7 15:49:51 2014
在写step response程式的时候:
den = [1 2 1];
num = [1 1];
sys = tf(num,den)
t = 0 : .01 :20
y = step(sys,t);
然後对y对t画图,以上这样写可以跑出正确结果,但如果是下面:
for t = 0 : .01 : 20
y = step(sys,t);
end
却跑出错误:
Error using DynamicSystem/step (line 96)
In time response commands, the final time must be
a positive scalar.
实在看不太懂事为什麽会错呢?
感谢大家解惑!!
--
╭──╮ 全 q ˙ . 全 ╭════╮
║ 灯 电 世 . 潘 ◤◥◤◥ 阳 街 世 │此路不通│
║││ 了 界 ˙威 在 一 起 建 . 了 界 ╰═ ╤ ═╯
║ 停 都 ‧ 伦 ◣ ◢ 福 . 封 都 │
║ ﹕. ˙ ‧ ‧ │
███ ψsleeeve ███
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 50.135.126.40
1F:→ s4300026:第一个方式t是阵列,第二个方式,t是单一值 01/07 17:58