⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 defsources_s.m

📁 Matlab雷达工具箱
💻 M
字号:
function [sys,x0,str,ts] = defsources_s(t,x,u,flag)%%   The general form of an M-File S-function syntax is:%       [SYS,X0,STR,TS] = SFUNC(T,X,U,FLAG,P1,...,Pn)%%   Optional parameters, P1,...,Pn can be provided to the S-function and%   used during any FLAG operation.switch flag,  case 0,    [sys,x0,str,ts]=mdlInitializeSizes;  case { 1, 2, 4, 9 }    sys=[];		% Unused flags  case 3,    sys=mdlOutputs(t,x,u);  otherwise    error(['Unhandled flag = ',num2str(flag)]);end%%=============================================================================% mdlInitializeSizes% Return the sizes, initial conditions, and sample times for the S-function.%=============================================================================%function [sys,x0,str,ts]=mdlInitializeSizes% call simsizes for a sizes structure, fill it in and convert it to a% sizes array.sizes = simsizes;sizes.NumContStates  = 0;sizes.NumDiscStates  = 0;sizes.NumOutputs     = 1;sizes.NumInputs      =-1;sizes.DirFeedthrough = 1;sizes.NumSampleTimes = 1;   % at least one sample time is neededsys = simsizes(sizes);x0  = [];		% No continuous statesstr = []; 	% str is always an empty matrix, reserved for future use by Simulinkts  = [0 0];	% initialize the array of sample times% end mdlInitializeSizes%=============================================================================% mdlOutputs% Return the block outputs.%=============================================================================function sys=mdlOutputs(t,x,u)% The complete subsystem block should have 3 input ports.% The input port vector contains references to the 3 variables that % contains the Target(s), Noise, and Clutter Definitions.    getinvar  for i=1:length(u)     eval(['tmpVar = inVar',num2str(i),';']);     inVarCell{i}=tmpVar;     eval('clear tmpVar');  end;  outVar1 = defsources(inVarCell);  eval(['clear inVarCell'])  putoutvarclear    %getinvar3  %outVar1 = defsources({inVar1,inVar2,inVar3});    % Calculate the DOA spectrum by a DBT function.  %putoutvarclear3    % Clear the variable "inVar1", "inVar2", inVar3" and puts the    % output variable "outVar1"    % to the next Simulink block.% end mdlOutputs

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -