欢迎来到天天文库
浏览记录
ID:59357115
大小:235.98 KB
页数:9页
时间:2020-09-04
《导入数据创建测试用例.docx》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、ImportingDatatoCreateanInputTestCase以下介绍两种方法1.从workspace2.从signalbuliderOnthispage…GuidelinesforImportingaTestCaseExampleofTestCaseDataUsingaFromWorkspaceBlocktoImportanInputTestCaseUsingaSignalBuilderBlocktoImportanInputTestCaseGuidelinesforImportingaTestCaseTypicallywhenimp
2、ortingatestcaseinSimulink,youwantto:·Createasignalthathasrampsandsteps.Inotherwords,thesignalhasoneormorediscontinuities.·Createthesignalusingthefewestpointspossible.以最少的点创建测试用例。·HavetheSimulinksolverexecuteatthespecifieddiscontinuities.使simulink在非连续点求解。ToimportthissignalinSi
3、mulink,useaFromWorkspace,FromFile,orSignalBuilderblock,allofwhichsupportzero-crossingdetection.ExampleofTestCaseDataThefollowingisanexampleoftestcasedata:Thefollowingtwoexamplesusethistestcasedata.UsingaFromWorkspaceBlocktoImportanInputTestCase1.Opentheex_data_import_test_cas
4、e_from_workspace.mdlmodel.2.Enablezero-crossingdetection.IntheFromWorkspaceblockdialog,selectEnablezero-crossingdetection.3.Createasignalstructureforthetestcase.Ateachdiscontinuity,enteraduplicateentryinthetimevector.AsdescribedintheFromWorkspaceblockdocumentation,thisgenerat
5、esazero-crossingandforcesthevariable-stepsolvertotakeatimestepatthisexacttime.创建结构体测试用例,每个断点,重复一次时间向量Definethevarstructurerepresentingthetestcase:var.time=[011558810];var.signals.values=[00222333]';var.signals.dimensions=1;4.Toimportthetestcasestructure,intheFromWorkspacebloc
6、kdialog,intheDataparameter,specifyvar.5.Simulatethemodel.TheScopeblockreflectsthetestcasedata.UsingaSignalBuilderBlocktoImportanInputTestCaseAsanalternativetousingaFromWorkspaceblock,youcanuseaSignalBuilderblocktoeithercreateasignalinteractivelyortoimportasignalfromaMAT-file.
7、1.Opentheex_data_import_signal_buildermodel.2.CreateastructureandsaveitinaMAT-file:3.var.time=[011558810];4.var.signals.values=[00222333]';5.var.signals.dimensions=1;6.var.signals.label='var';7.savevar.matvar8.Double-clicktheSignalBuilderblocktoopenitsdialogbox.9.SelectFile>I
8、mportFromFilemenuitem,andselectthevar.matfile.10.IntheSelectparamete
此文档下载收益归作者所有