mlx脚本生成simulink模型(3)
求解器及代码生成配置
1、获取并设置参数名
设置求解器及代码生成的相关配置使用set_param参数,不知道参数名的情况,可以将鼠标移至参数上右击,点击出现的What’s This? 标签
2、常用示例
% Solver
set_param(node,'StartTime', '0.0'); % Start time
set_param(node,'StopTime', 'inf'); % Stop time
set_param(node,'SolverType', 'Fixed-step'); % Type
set_param(node,'Solver', 'FixedStepDiscrete'); % Solver
set_param(node,'FixedStep', '0.001'); % Fixed-step size (fundamental sample time)
% Tasking and sample time options
set_param(node,'SampleTimeConstraint', 'Unconstrained'); % Periodic sample time constraint
set_param(node,'EnableMultiTasking', 'on'); % Treat each discrete rate as a separate task
set_param(node,'ConcurrentTasks', 'off'); % Allow tasks to execute concurrently on target
set_param(node,'AutoInsertRateTranBlk', 'off'); % Automatically handle rate transition for data transfer
set_param(node,'PositivePriorityOrder', 'off'); % Higher priority value indicates higher task priority
% Code Generation
set_param(node,'SystemTargetFile', 'VeriStand.tlc'); %Target
set_param(node,'Toolchain', 'VeriStand Compiler for Linux64 targets | gmake makefile (64-bit Linux)'); % Toolchain