帮助中心帮助中心
指定MATLAB通过完成每个模拟完成后运行的功能仿真input目的,在
仿真input
在
in = in.setpostsimfcn(func)
例子
in = in.setpostsimfcn(功能)注册与功能句柄关联的回调函数功能每个模拟完成后。这金宝appSimulink.SimulationInput对象作为参数传递给此功能。功能是任何MATLAB®功能,可用于对输出进行后处理。要返回后处理的数据,您必须在结构中返回为值。然后将这些值包装到金宝appsimulink.simulationOutput输出以替换通常的记录数据或将新数据添加到金宝appsimulink.simulationOutput目的。
in = in.setpostsimfcn(功能)
功能
金宝appSimulink.SimulationInput
金宝appsimulink.simulationOutput
全部收缩
此示例通过仿真input每个模拟完成后运行的对象。
创建一个postimfcn获取输出的平均值。
postimfcn
功能newout = postsim(out);newout.mean = mean(out.yout);结尾
创建一个仿真input模型的对象。
in = 金宝appsimulink.simulationInput('vdp');in = in.setPostSimfcn(@(x)postsim(x));in = in.setModelParameter(“ saveoutput”,,,,'上');
模拟模型。
out = sim(in)
查看您的结果
均值
最好的做法是避免使用'错误信息'和“仿真”作为功能中的字段名称。
'错误信息'
“仿真”
每个模拟完成后运行的功能,指定为函数句柄或函数名称。setPostsimfcn通过金宝appSimulink.SimulationInput对象形状y争论。例如:
setPostsimfcn
y
in = in.setPresimfcn(@myfunc,y)
myfunc
功能f = myfunc(x)f...%以x作为输入参数计算功能值
in = in.setPostSimfcn(@(y)myFunction(arg1,arg2)...))
金宝appSimulink.SimulationInput|Parsim|ApplyTomodel|setBlockParameter|setModelParameter|setInitialState|setExternalInput|setVaria|证实|setpresimfcn|loadVariables frommatfile|模拟管理器
Parsim
ApplyTomodel
setBlockParameter
setModelParameter
setInitialState
setExternalInput
setVaria
证实
setpresimfcn
loadVariables frommatfile
模拟管理器
Ha Hecho Clic en ener eNRACE que对应了este comando de matlab:
Ejecute El Comando介绍了comandos de Matlab。Los Navegadores Web no Anditen comandos de Matlab。
选择一个网站以获取可用的翻译内容,并查看本地事件和优惠。根据您的位置,我们建议您选择:。
您还可以从以下列表中选择一个网站:
选择中国网站(中文或英语)以获得最佳场地性能。其他Mathworks乡村网站未针对您所在的访问进行优化。
联系您当地的办公室