copySimulationSettings
类: sltest.testmanager.TestCase
命名空间: sltest.testmanager
复制等效性测试用例中的仿真设置
语法
copySimulationSettings(tc,fromSimIndex,toSimIndex)
说明
copySimulationSettings(
在等效性测试用例中将仿真设置从一个仿真号复制到另一个仿真号。此功能仅适用于等效性测试用例类型。tc
,fromSimIndex
,toSimIndex
)
输入参数
tc
— 等价性测试用例
sltest.testmanager.TestCase
对象
您想要复制仿真设置的等效性测试用例,指定为 sltest.testmanager.TestCase
对象。
fromSimIndex
— 从仿真号复制
1 | 2
您要从中复制设置的仿真编号,指定为整数,1
或 2
。这是源仿真。
toSimIndex
— 复制到仿真号
1 | 2
要将设置复制到的仿真编号,指定为整数,1
或 2
。这就是目标仿真。
示例
复制测试用例中的仿真设置
% Open the model for this example openExample('sldemo_absbrake'); % Create the test file, test suite, and test case structure tf = sltest.testmanager.TestFile('API Test File'); ts = createTestSuite(tf,'API Test Suite'); tc = createTestCase(ts,'equivalence','Equivalence Test Case'); % Remove the default test suite tsDel = getTestSuiteByName(tf,'New Test Suite 1'); remove(tsDel); % Assign the system under test to the test case % for Simulation 1 and Simulation 2 setProperty(tc,'Model','sldemo_absbrake','SimulationIndex',1); setProperty(tc,'Model','sldemo_absbrake','SimulationIndex',2); % Change simulation stop time in Simulation 1 setProperty(tc,'StopTime',100,'SimulationIndex',1); % Copy simulation setting to Simulation 2 copySimulationSettings(tc,1,2);
版本历史记录
在 R2015b 中推出
另请参阅
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)