📄 noiseblk_f.sci
字号:
//NOISEBLK_f Scicos Gaussian Random Generator
//Classical interface function ver1.0 - scilab-3
//7 juillet 2004 Author : - IRCOM GROUP - A.Layec
function [x,y,typ]=NOISEBLK_f(job,arg1,arg2)
x=[];y=[];typ=[]
select job
case 'plot' then
standard_draw(arg1)
case 'getinputs' then
[x,y,typ]=standard_inputs(arg1)
case 'getoutputs' then
[x,y,typ]=standard_outputs(arg1)
case 'getorigin' then
[x,y]=standard_origin(arg1)
case 'set' then
x=arg1;
graphics=arg1.graphics;model=arg1.model;
exprs=graphics.exprs;
while %t do
text=['Set Scicos Gaussian Noise Generator']
[ok,ny,sig,moy,seed,typ,exprs]=getvalue(text,...
['Size of outputs';'sigma';'mean';'seed';'Type'],...
list('vec',1,'vec',-1,'vec',-1,'vec',1,'vec',1),exprs)
if ~ok then break,end;
sz_out=size(ny,'*');
//if sz_out>2 then
// ok=%f
// message('Vector of size of outputs must have a size <= 2')
//else
if ok then
graphics.exprs=exprs
model.in=[]
if(typ==2) then
[model,graphics,ok]=check_io(model,graphics,[],[ny;ny],[1],[])
model.out=[ny;ny]
else
[model,graphics,ok]=check_io(model,graphics,[],[ny],[1],[])
model.out=ny;
end
model.dstate=[]
model.ipar=[int(seed);typ]
model.rpar=[sig(:);moy(:)]
x.graphics=graphics;x.model=model
break;
end
end
case 'define' then
ny=64
sig=0.1*ones(ny,1)
moy=0*ones(ny,1)
seed=int(rand()*1e8)
typ=0
model=scicos_model()
model.sim=list('noiseblk',4)
model.in=[]
model.out=ny;
model.evtin=[1]
model.evtout=[]
model.dstate=[]
model.rpar=[sig(:);moy(:)]
model.ipar=[seed;typ]
model.blocktype='d'
model.firing=[]
model.dep_ut=[%f %f]
gr_i=['txt=[''Random'';''Generator''];';
'xstringb(orig(1),orig(2),txt,sz(1),sz(2),''fill'');']
exprs=[string(ny),'0.1*ones(64,1)','0*ones(64,1)',string('int(rand()*1e8)'),string(typ)]
x=standard_define([2 2],model,exprs,gr_i)
x.graphics.id="Muller Law"
end
endfunction
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -