asd 发表于 2005-11-22 09:32

Subscript indices must either be real positive integers or logicals?

matlab 请教
t0=0;tf=1e-7;dt=2e-9;t1=2e-8;t=t0:dt:tf;
f(t>=2e-8)=0;
f(t<2e-8)=1;
for i=1:51
k3(i)=500*f(t(i))
end
运行后:
Subscript indices must either be real positive integers or logicals.

[ 本帖最后由 ChaChing 于 2009-7-11 18:51 编辑 ]

happy 发表于 2005-11-22 13:25

回复:(asd)matlab 请教

t0=0;tf=1e-7;dt=2e-9;t1=2e-8;t=t0:dt:tf;<BR>for i=1:51<BR>    f(t(i)&gt;=2e-8)=0;<BR>    f(t(i)&lt;2e-8)=1;<BR>    k3(i)=500*f;<BR>end<BR>

asd 发表于 2005-11-23 12:58

thank you very much!
页: [1]
查看完整版本: Subscript indices must either be real positive integers or logicals?