function [ret,x0,str,ts,xts]=askwnymf(t,x,u,flag);
%ASKWNYMF is the M-file description of the SIMULINK system named ASKWNYMF.
% The block-diagram can be displayed by typing: ASKWNYMF.
%
% SYS=ASKWNYMF(T,X,U,FLAG) returns depending on FLAG certain
% system values given time point, T, current state vector, X,
% and input vector, U.
% FLAG is used to indicate the type of output to be returned in SYS.
%
% Setting FLAG=1 causes ASKWNYMF to return state derivatives, FLAG=2
% discrete states, FLAG=3 system outputs and FLAG=4 next sample
% time. For more information and other options see SFUNC.
%
% Calling ASKWNYMF with a FLAG of zero:
% [SIZES]=ASKWNYMF([],[],[],0), returns a vector, SIZES, which
% contains the sizes of the state vector and other parameters.
% SIZES(1) number of states
% SIZES(2) number of discrete states
% SIZES(3) number of outputs
% SIZES(4) number of inputs
% SIZES(5) number of roots (currently unsupported)
% SIZES(6) direct feedthrough flag
% SIZES(7) number of sample times
%
% For the definition of other parameters in SIZES, see SFUNC.
% See also, TRIM, LINMOD, LINSIM, EULER, RK23, RK45, ADAMS, GEAR.
% Note: This M-file is only used for saving graphical information;
% after the model is loaded into memory an internal model
% representation is used.
% the system will take on the name of this mfile:
sys = mfilename;
new_system(sys)
simver(1.3)
if (0 == (nargin + nargout))
set_param(sys,'Location',[196,42,1260,318])
open_system(sys)
end;
set_param(sys,'algorithm', 'RK-45')
set_param(sys,'Start time', '0.0')
set_param(sys,'Stop time', '999999')
set_param(sys,'Min step size', '.000001')
set_param(sys,'Max step size', '10')
set_param(sys,'Relative error','1e-6')
set_param(sys,'Return vars', '')
% Subsystem 'Kanal'.
new_system([sys,'/','Kanal'])
set_param([sys,'/','Kanal'],'Location',[11,262,273,408])
add_block('built-in/Inport',[sys,'/','Kanal/in_1'])
set_param([sys,'/','Kanal/in_1'],...
'position',[45,10,65,30])
add_block('built-in/Outport',[sys,'/','Kanal/out_1'])
set_param([sys,'/','Kanal/out_1'],...
'position',[200,55,220,75])
add_block('built-in/Sum',[sys,'/','Kanal/Sum'])
set_param([sys,'/','Kanal/Sum'],...
'position',[150,55,170,75])
% Subsystem ['Kanal/Gaussian noise',13,'generator'].
new_system([sys,'/',['Kanal/Gaussian noise',13,'generator']])
set_param([sys,'/',['Kanal/Gaussian noise',13,'generator']],'Location',[22,119,370,243])
add_block('built-in/State-Space',[sys,'/',['Kanal/Gaussian noise',13,'generator/Matrix',13,'Gain']])
set_param([sys,'/',['Kanal/Gaussian noise',13,'generator/Matrix',13,'Gain']],...
'A','[]',...
'B','[]',...
'C','[]',...
'D','K',...
'Mask Display','K',...
'Mask Type','Matrix Gain',...
'Mask Dialogue','Matrix Gain.|Gain matrix:')
set_param([sys,'/',['Kanal/Gaussian noise',13,'generator/Matrix',13,'Gain']],...
'Mask Translate','K = @1;',...
'Mask Help','Multiplies input vector by entered matrix to produce output vector (y=Au).',...
'Mask Entries','d\/')
set_param([sys,'/',['Kanal/Gaussian noise',13,'generator/Matrix',13,'Gain']],...
'position',[140,61,165,89])
add_block('built-in/White Noise',[sys,'/',['Kanal/Gaussian noise',13,'generator/Random',13,'Number']])
set_param([sys,'/',['Kanal/Gaussian noise',13,'generator/Random',13,'Number']],...
'Seed','s',...
'position',[35,57,80,93])
add_block('built-in/Constant',[sys,'/',['Kanal/Gaussian noise',13,'generator/Constant']])
set_param([sys,'/',['Kanal/Gaussian noise',13,'generator/Constant']],...
'Value','m',...
'position',[140,20,160,40])
add_block('built-in/Sum',[sys,'/',['Kanal/Gaussian noise',13,'generator/Sum']])
set_param([sys,'/',['Kanal/Gaussian noise',13,'generator/Sum']],...
'position',[220,60,240,80])
add_block('built-in/Outport',[sys,'/',['Kanal/Gaussian noise',13,'generator/out_1']])
set_param([sys,'/',['Kanal/Gaussian noise',13,'generator/out_1']],...
'position',[285,60,305,80])
add_line([sys,'/',['Kanal/Gaussian noise',13,'generator']],[165,30;190,30;190,65;215,65])
add_line([sys,'/',['Kanal/Gaussian noise',13,'generator']],[245,70;280,70])
add_line([sys,'/',['Kanal/Gaussian noise',13,'generator']],[170,75;215,75])
add_line([sys,'/',['Kanal/Gaussian noise',13,'generator']],[85,75;135,75])
set_param([sys,'/',['Kanal/Gaussian noise',13,'generator']],...
'Mask Display','plot(0,0,100,100,x,y);Gaussian',...
'Mask Type','Gaussian noise generator')
set_param([sys,'/',['Kanal/Gaussian noise',13,'generator']],...
'Mask Dialogue','Generate Gaussian distributed noise with\ngiven mean and variance value.|Mean value:|Variance (vector or matrix):|Initial seed:')
set_param([sys,'/',['Kanal/Gaussian noise',13,'generator']],...
'Mask Translate','m=@1;d=@2;s=@3;[m,d,s]=gwnoise(m,d,s);[x,y]=srcsicon(3);')
set_param([sys,'/',['Kanal/Gaussian noise',13,'generator']],...
'Mask Help','When the mean value and seed are vectors, the output of this block is a vector. The length of the vector is the same as the length of the mean value vector or the length of the seed. When the variance entry is a vector, the variance is a diagonal matrix.')
set_param([sys,'/',['Kanal/Gaussian noise',13,'generator']],...
'Mask Entries','m\/d\/s\/')
% Finished composite block ['Kanal/Gaussian noise',13,'generator'].
set_param([sys,'/',['Kanal/Gaussian noise',13,'generator']],...
'position',[25,48,105,92])
add_line([sys,'/','Kanal'],[175,65;195,65])
add_line([sys,'/','Kanal'],[70,20;115,20;115,60;145,60])
add_line([sys,'/','Kanal'],[110,70;145,70])
set_param([sys,'/','Kanal'],...
'Mask Display','plot(0,0,100,100,x,y);AWGN',...
'Mask Type','AWGN channel, fixed parameter')
set_param([sys,'/','Kanal'],...
'Mask Dialogue','Additive white Gaussian noise channel\nwith fixed mean and variance.|Mean value:|Variance (std^2):|Initial Seed:',...
'Mask Translate','m=@1;d=@2;s=@3;[m,d,s]=gwnoise(m,d,s);[x,y]=chanicon;')
set_param([sys,'/','Kanal'],...
'Mask Help','This block adds white Gaussian noise to the input signal. The mean and the variance can be a scalar or vector with the same length as the input signal.',...
'Mask Entries','0\/.001\/12345\/')
% Finished composite block 'Kanal'.
set_param([sys,'/','Kanal'],...
'position',[480,113,560,157])
% Subsystem 'MASK map'.
new_system([sys,'/','MASK map'])
set_param([sys,'/','MASK map'],'Location',[520,162,902,335])
add_block('built-in/Constant',[sys,'/','MASK map/Gain diff'])
set_param([sys,'/','MASK map/Gain diff'],...
'Value','Ac',...
'position',[180,96,215,124])
add_block('built-in/Sum',[sys,'/','MASK map/Sum1'])
set_param([sys,'/','MASK map/Sum1'],...
'inputs','+-',...
'position',[250,63,270,87])
add_block('built-in/Gain',[sys,'/','MASK map/Gain'])
set_param([sys,'/','MASK map/Gain'],...
'Gain','Kc',...
'position',[180,25,220,55])
add_block('built-in/Inport',[sys,'/','MASK map/in_1'])
set_param([sys,'/','MASK map/in_1'],...
'position',[40,30,60,50])
add_block('built-in/Zero-Order Hold',[sys,'/',['MASK map/Zero-Order',13,'Hold']])
set_param([sys,'/',['MASK map/Zero-Order',13,'Hold']],...
'Sample time','td',...
'position',[100,24,135,56])
add_block('built-in/Outport',[sys,'/','MASK map/out_1'])
set_param([sys,'/','MASK map/out_1'],...
'position',[315,65,335,85])
add_line([sys,'/','MASK map'],[140,40;175,40])
add_line([sys,'/','MASK map'],[65,40;95,40])
add_line([sys,'/','MASK map'],[275,75;310,75])
add_line([sys,'/','MASK map'],[220,110;230,110;230,80;245,80])
add_line([sys,'/','MASK map'],[225,40;230,40;230,70;245,70])
set_param([sys,'/','MASK map'],...
'Mask Display','MASK\nmap',...
'Mask Type','MASK map')
set_param([sys,'/','MASK map'],...
'Mask Dialogue','Map a digital symbol onto an analog\nsignal in the range [-1, 1] using M-ary\namplitude shift keying modulation mapping.|M-ar