0

如何让这个“for循环”在matlab中绘制100个值?无法确定在哪里包含“i”
这是共发射极放大器工作点的蒙特卡罗分析图

for i=1:100
   Rb = 377000 * (1 + (rand()*2-1)*0.01);
   Rc = 1000 * (1 + (rand()*2-1)*0.01);
   Beta = 200 + 100*(rand()*2-1);
   Ib = (12-0.7)/Rb;
   Ic = Beta*Ib;
   Vc = 12-Ic*Rc;
   plot(Vc,Ic*1000,'.');
   end
4

1 回答 1

0

在此处输入图像描述那这个呢 ?加持你得到比你100分??

 figure;
 axes('NextPlot',add'); %This remove the need to call hold on, also  I added an extra ' for SO formatting
 for i=1:100
    Rb = 377000 * (1 + (rand()*2-1)*0.01);
    Rc = 1000 * (1 + (rand()*2-1)*0.01);
    Beta = 200 + 100*(rand()*2-1);
    Ib = (12-0.7)/Rb;
    Ic = Beta*Ib;
    Vc = 12-Ic*Rc;
    plot(Vc,Ic*1000,'.');
  end
于 2013-02-23T20:31:15.360 回答