flyingboat 发表于 2011-4-26 10:03:02

inc和inc0

本帖最后由 flyingboat 于 2011-4-26 10:04 编辑

请教各位大虾,inc和inc0区别是什么啊!万分感谢!

wzliniam 发表于 2011-4-26 14:01:03

inc是对所有变量值的初始值的设定
inc0只能对属于输入输出的变量初始值设定

diguasix 发表于 2011-11-29 22:07:57

回复 2# wzliniam
那inc0用就可以用inc代替了吗?说明书里的区别不太懂……麻烦讲解一下,谢谢

inc(varnm) = expr
Definition of the initial condition of variable varnm. If inc(varnm) is not defined, the normal assignment expression will be evaluated (only possible if varnm is of the intern or input type). If inc(varnm) is defined, it will be evaluated when the model resets.

inc0(varnm) = expr
Definition of the initial condition of variable varnm, for unconnected output or input variables. This variant of the inc() statement is used only when the variable varnm could not be initialized through the initial condition of the connected input or output signal. The inc0() statement is thus used to make open input or output terminals possible.

wzliniam 发表于 2011-11-30 09:45:49

inc用于变量的初始设定,若变量的初始值未定义,此变量的初始值由赋值语句给出(只限于内部变量和输入的变量)
inc0用于未连接的输出和输入变量的初始值定义。inc仅仅用于当变量无法从初始的输入输出信号给出初始值时。

金刚狼UPC 发表于 2011-12-1 14:30:23

回复 4# wzliniam


    谢谢你的回答,也正在为这个问题伤脑子。
页: [1]
查看完整版本: inc和inc0

招聘斑竹