求教!一个matlab程序!!怎么运行不出来啊
for n=1:100<BR>%DNL_TH=linspace(0, 0, 1024)<BR>%初始化非线性误差<BR>UNITSOURCE=1+0.02*(randn(1,1024));<BR>%1024个电流源,每个电流源的大小为“1",标准方差为“0. 02"<BR>%BINARAYSOURCE=linspace(0,0,10);<BR>%初始化二进制加权DAC<BR>TOTAL_CURRENT=O;<BR>for i=1:1024<BR>TOTAL_CURRENT=TOTAL_CURRENT+UNITSOURCE(i);<BR>DNL_TH(i)=UNITSOURCE(i)-1;<BR>%计算每一个温度码的DNL<BR>end<BR>plot (DNL_TH,'black');<BR>hold on;<BR>end错拉,更正:
DNL_TH=linspace(0, 0, 1024)<BR>该句前面没有%的<BR><BR>回复:(bluesky140)求教!一个matlab程序!!怎么运...
<DIV class=quote><B>以下是引用<I>bluesky140</I>在2006-3-2 17:37:12的发言:</B><BR>for n=1:100<BR>%DNL_TH=linspace(0, 0, 1024)<BR>%初始化非线性误差<BR>UNITSOURCE=1+0.02*(randn(1,1024));<BR>%1024个电流源,每个电流源的大小为“1",标准方差为“0. 02"<BR>%BINARAYSOURCE=linspace(0,0,10);<BR>%初始化二进制加权DAC<BR><FONT color=#ff0000>TOTAL_CURRENT=O;<BR></FONT>for i=1:1024<BR>TOTAL_CURRENT=TOTAL_CURRENT+UNITSOURCE(i);<BR>DNL_TH(i)=UNITSOURCE(i)-1;<BR>%计算每一个温度码的DNL<BR>end<BR>plot (DNL_TH,'black');<BR>hold on;<BR>end</DIV><P><BR>这里是0不是O吧</P>
页:
[1]