2013-02-23 82 views
0

如何讓這個'for循環'在matlab中繪製100個值?想不出哪裏有「我」
這是一個共發射極放大器如何讓這個'循環'在matlab中繪製100個值?

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 

回答

0

enter image description here這個東西的工作點的蒙特卡羅分析圖?加上持有你比你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 
+1

可惜沒MATLAB不起作用一樣, – user1945925 2013-02-23 20:37:07

+0

對不起我與SCILAB工作,現在這就是爲什麼 – Engine 2013-02-23 20:49:09

+0

,他們都應該有非常相似的語法,在........其實搭售「舉行在'使它的工作表示感謝!不知道那是什麼。我會調查! – user1945925 2013-02-23 20:56:00