淘宝官方店     推荐课程     在线工具     联系方式     关于我们  
 
 

微波射频仿真设计   Ansoft Designer 中文培训教程   |   HFSS视频培训教程套装

 

Agilent ADS 视频培训教程   |   CST微波工作室视频教程   |   AWR Microwave Office

          首页 >> Ansoft Designer >> Ansoft Designer在线帮助文档


Ansoft Designer / Ansys Designer 在线帮助文档:


Nexxim Simulator >
Nexsys Discrete Time Domain Analysis >
   Nexsys MATLAB User Defined Models >
       The Nexsys MATLAB Model File >
           MATLAB Function Definition               


MATLAB Function Definition

After the model definition line, the model file contains the definition of the function that implements the model code.

The second line in the model file must be the MATLAB function declaration line. The format of the function declaration line depends on the model type. Nexsys supports modeling of sources or input/output (I/O) model types, defined by the numbers of inputs and outputs.

A SOURCE model has no input ports (In_N=0) and one or more output ports (Out_N>0). A SOURCE model must have parameters NSAMP and SAMPLE_RATE in the parameter_list in the model definition line.

An I/O model has one or more input ports (In_N>0) and one or more output ports (Out_N>0). The format for the function declaration of an I/O model depends on whether or not it has a parameter_list in the model definition line.

For SOURCE UDMs the syntax for the function declaration line is:

function[outputs,SV] = function_name(parameters, SV, status_in)

For I/O UDMS with no parameter_list in the model definition line:

function[outputs,SV] = function_name(inputs, SV, status_in)

For I/O UDMS (In_N > 0) with a non-empty parameter_list in the model definition line:

function[outputs,SV] = function_name(inputs, parameters, SV, status_in)

The entries in the function declarations are defined as follows:

•  outputs is the user-defined name of a two dimensional array with Out_N rows, each row corresponding to an output port in the same order specified in the UDM definition.

•  inputs is a the user-defined name of a two dimensional array with In_N rows, each row corresponding to an input port in the same order specified in the UDM definition.

•  parameters is the user-defined name of a one dimensional array containing the parameter values entered for the model instance in the same order defined in parameter_string.

•  SV is a system-defined structure that retains the state variables of a MATLAB UDM. State variables are any structured data defined by the model file that must be saved between calls to the model. The first time a model is called, the simulator assigns a zero value to SV before passing it to the user-defined MATLAB function. During initialixzation (status_in = 0), the model saves any needed data structures in SV before passing the SV data back to Nexsys with the output of the function. Nexsys retains the SV information and passes it back to the MATLAB UDM function on the next invocation. If data retentiontion is not required, the function does not need to initialize or set SV.

•  status_in is a system-defined flag to indicate the input status when calling a MATLAB UDM function. (status_in = 0 for the initialization stage, non_zero otherwise.




HFSS视频教学培训教程 ADS2011视频培训教程 CST微波工作室教程 Ansoft Designer 教程

                HFSS视频教程                                      ADS视频教程                               CST视频教程                           Ansoft Designer 中文教程


 

      Copyright © 2006 - 2013   微波EDA网, All Rights Reserved    业务联系:mweda@163.com