MATLAB



This extension enables you to run MATLAB® scripts, functions, and statements as part of your build pipeline. You also can run your MATLAB and Simulink® tests, generate artifacts such as JUnit test results and Cobertura code coverage reports, and publish your results to Azure Pipelines.

MATLAB is a package that has been purpose-designed to make computations easy, fast and reliable. It is installed on machines run by Bath University Computing Services (BUCS), which can be accessed in the BUCS PC Labs such as those in 1 East 3.9, 1 West 2.25 or 3 East 3.1, as well as from any of the PCs in the. MATLAB (an abbreviation of 'matrix laboratory') is a proprietary multi-paradigm programming language and numeric computing environment developed by MathWorks.MATLAB allows matrix manipulations, plotting of functions and data, implementation of algorithms, creation of user interfaces, and interfacing with programs written in other languages.

To run your pipeline using the extension, install the extension to your Azure DevOps organization. (To install the extension, press the Get it free button at the top of this page.) You can use the extension with self-hosted or Microsoft®-hosted agents:

  • If you want to use a self-hosted agent, you must set up a computer with MATLAB (R2013b or later) as your self-hosted agent and register the agent with Azure Pipelines.

  • If you want to use a Microsoft-hosted agent, you must include a task in your pipeline to install MATLAB on the agent. Currently, this task is available only for public projects and does not include transformation products, such as MATLAB Coder™ and MATLAB Compiler™.

Usage Examples

When you author your pipeline, the extension provides you with a task to run MATLAB scripts, functions, and statements. The extension also provides a task to run MATLAB and Simulink tests. Additionally, you can specify a Microsoft-hosted agent to run your MATLAB code.

Run MATLAB Script

Use the Run MATLAB Command task to run MATLAB scripts, functions, and statements tailored to your specific needs. You can use this task to flexibly customize your test run or add a build step to your pipeline.

For example, in a file named azure-pipelines.yml in the root of your repository, author a pipeline to run the commands in a file named myscript.m.

Run Tests in MATLAB Project

Use the Run MATLAB Tests task to automatically run tests authored using the MATLAB Unit Testing Framework or Simulink Test™. You can use this task to generate different types of test and coverage artifacts. You can then publish the artifacts to Azure Pipelines.

For example, author a pipeline to run the tests in your MATLAB project automatically, and then generate a PDF test results report, JUnit test results report, and Cobertura code coverage report at specified locations on the build agent. Use tasks to publish the generated artifacts to Azure Pipelines once the tests are executed. You can access the artifacts in the pipeline summary window:

  • To download the PDF test results report, follow the published link.
  • To view the JUnit test results report, open the Tests tab.
  • To view the Cobertura code coverage report, open the Code Coverage tab.

Specify MATLAB in Pipeline

When you use the Run MATLAB Command or Run MATLAB Tests tasks in your pipeline, the self-hosted agent uses the topmost MATLAB version on the system path. The build fails if the operating system cannot find MATLAB on the path.

You can prepend your desired version of MATLAB to the PATH environment variable of the agent. For example, prepend MATLAB R2020b to the path and use it to run your script.

Use MATLAB on Microsoft-Hosted Agent

Use the Install MATLAB task when you want to run MATLAB code in public projects that utilize Microsoft-hosted agents. The task installs your specified MATLAB release (R2020a or later) on a Linux® virtual machine and enables the agent to run MATLAB scripts, functions, statements, and tests. If you do not specify a release, the task installs the latest release of MATLAB.

Use this task in conjunction with the Run MATLAB Command or Run MATLAB Tests tasks. For example, install MATLAB R2020a on a Microsoft-hosted agent to run the commands in your script.

Tasks

You can access the extension tasks and add them to your pipeline when you edit your pipeline in Azure DevOps.

Run MATLAB Command

Execute a MATLAB script, function, or statement. Specify the task in your pipeline YAML using the RunMATLABCommand key.

MATLAB
ArgumentDescription
command(Required) Script, function, or statement to execute. If the value of command is the name of a MATLAB script or function, do not specify the file extension. If you specify more than one MATLAB command, use a comma or semicolon to separate the commands.
Example:myscript
Example:results = runtests, assertSuccess(results);

MATLAB exits with exit code 0 if the specified script, function, or statement executes successfully without error. Otherwise, MATLAB terminates with a nonzero exit code, which causes the build to fail. You can use the assert or error functions in the command to ensure that builds fail when necessary.

When you use this task, all of the required files must be on the MATLAB search path.

Matlab Onramp

Run MATLAB Tests

Run the tests in a MATLAB project and generate artifacts. Specify the task in your pipeline YAML using the RunMATLABTests key.

By default, MATLAB includes any files in your project that have a Test label. If your pipeline does not leverage a MATLAB project or uses a MATLAB release before R2019a, then MATLAB includes all tests in the root of your repository including its subfolders.

The Run MATLAB Tests task lets you customize your test run using optional arguments. For example, you can add folders to the MATLAB search path, have control over which tests to run, and generate different types of artifacts.

ArgumentDescription
sourceFolder(Optional) Locations of the folders containing source code, relative to the project root folder. The specified folders and their subfolders are added to the top of the MATLAB search path. To generate a code coverage report, MATLAB uses only the source code in the specified folders and their subfolders. You can specify multiple folders using a colon-separated or semicolon-separated list.
Example:source
Example:source/folderA; source/folderB
selectByFolder(Optional) Locations of the folders used to select test suite elements, relative to the project root folder. To create a test suite, MATLAB uses only the tests in the specified folders and their subfolders. You can specify multiple folders using a colon-separated or semicolon-separated list.
Example:test
Example:test/folderA; test/folderB
selectByTag(Optional) Test tag used to select test suite elements. To create a test suite, MATLAB uses only the test elements with the specified tag.
Example:Unit
testResultsPDF(Optional) Path to write test results report in PDF format (currently not supported on macOS platforms).
Example:test-results/results.pdf
testResultsJUnit(Optional) Path to write test results report in JUnit XML format.
Example:test-results/results.xml
testResultsSimulinkTest(Optional) Path to export Simulink Test Manager results in MLDATX format (requires Simulink Test license and is supported in MATLAB R2019a or later).
Example:test-results/results.mldatx
codeCoverageCobertura(Optional) Path to write code coverage report in Cobertura XML format.
Example:code-coverage/coverage.xml
modelCoverageCobertura(Optional) Path to write model coverage report in Cobertura XML format (requires Simulink Coverage™ license and is supported in MATLAB R2018b or later).
Example:model-coverage/coverage.xml

Install MATLAB

Install the specified MATLAB release on a Linux agent in the cloud. Specify the task in your pipeline YAML using the InstallMATLAB key.

ArgumentDescription
release(Optional) MATLAB release to install. You can specify R2020a or a later release. If you do not specify release, the task installs the latest release of MATLAB.
Example:R2020a

Currently, this task is available only for public projects and does not include transformation products, such as MATLAB Coder and MATLAB Compiler.

Contact Us

If you have any questions or suggestions, please contact MathWorks® at continuous-integration@mathworks.com.

Simulink
Developer(s)MathWorks
Stable release
10.2 (part of R2020b) / September 17, 2020; 6 months ago
Operating systemLinux, macOS, Microsoft Windows[1]
LicenseProprietary
Websitemathworks.com

Simulink is a MATLAB-based graphical programming environment for modeling, simulating and analyzing multidomain dynamical systems. Its primary interface is a graphical block diagramming tool and a customizable set of block libraries. It offers tight integration with the rest of the MATLAB environment and can either drive MATLAB or be scripted from it. Simulink is widely used in automatic control and digital signal processing for multidomain simulation and model-based design.[2][3]

Add-on products[edit]

MathWorks and other third-party hardware and software products can be used with Simulink. For example, Stateflow extends Simulink with a design environment for developing state machines and flow charts.

Matlab Onramp

MathWorks claims that, coupled with another of their products,[4] Simulink can automatically generateCsource code for real-time implementation of systems. As the efficiency and flexibility of the code improves, this is becoming more widely adopted for production systems,[5][6] in addition to being a tool for embedded system design work because of its flexibility and capacity for quick iteration[citation needed]. Embedded Coder creates code efficient enough for use in embedded systems.[7][8][9]

Simulink Real-Time (formerly known as xPC Target), together with x86-based real-time systems, is an environment for simulating and testing Simulink and Stateflow models in real-time on the physical system. Another MathWorks product[10] also supports specific embedded targets. When used with other generic products,[11] Simulink and Stateflow can automatically generate synthesizableVHDL and Verilog[citation needed].

Simulink Verification and Validation enables systematic verification and validation of models through modeling style checking, requirements traceability and model coverage analysis. Simulink Design Verifier uses formal methods to identify design errors like integer overflow, division by zero and dead logic, and generates test case scenarios for model checking within the Simulink environment.

SimEvents is used to add a library of graphical building blocks for modeling queuing systems to the Simulink environment, and to add an event-based simulation engine to the time-based simulation engine in Simulink.[12]

Therefore in Simulink any type of simulation can be done and the model can be simulated at any point in this environment.

Different type of blocks can be accessed using the Simulink library browser. And therefore the benefit could be taken out from this environment efficiently.

Release history[edit]

MATLAB Version[13][14]Release nameSimulink versionYearNotes
1.01984
21986
31987
3.51990Ran on MS-DOS but required at least a 386 processor. Version 3.5m required math coprocessor
41992Renamed from Simulab to SIMULINK[15]
4.2cR71994Ran on Windows 3.1. Required a math coprocessor
5.0R81996
5.1R91997
5.1.1R9.1
5.2R101998
5.2.1R10.1
5.3R111999
5.3.1R11.1
6.0R122000
6.1R12.12001
6.5R13Simulink 5.0.22002
6.5.1R13SP1Simulink 5.12003
6.5.2R13SP2Simulink 5.2
7R14Simulink 6.02004
7.0.1R14SP1Simulink 6.1
7.0.4R14SP2Simulink 6.22005
7.1R14SP3Simulink 6.3
7.2R2006aSimulink 6.42006
7.3R2006bSimulink 6.5
7.4R2007aSimulink 6.62007
7.5R2007bSimulink 7.0Last release for Windows 2000 and PowerPC Mac.
7.6R2008aSimulink 7.12008
7.7R2008bSimulink 7.2
7.8R2009aSimulink 7.32009First release for 32-bit & 64-bit Windows 7.
7.9R2009bSimulink 7.4First release for Intel 64-bit Mac, and last for Solaris SPARC.
7.10R2010aSimulink 7.52010Last release for Intel 32-bit Mac.
7.11R2010bSimulink 7.6
7.12R2011aSimulink 7.72011
7.13R2011bSimulink 7.8
7.14R2012aSimulink 7.92012
8R2012bSimulink 8.0
8.1R2013aSimulink 8.12013
8.2R2013bSimulink 8.2
8.3R2014aSimulink 8.32014
8.4R2014bSimulink 8.4
8.5R2015aSimulink 8.52015
8.6R2015bSimulink 8.6Last release supporting 32-bit Windows
9.0R2016aSimulink 8.72016
9.1R2016bSimulink 8.8
9.2R2017aSimulink 8.92017
9.3R2017bSimulink 9.0
9.4R2018aSimulink 9.12018
9.5R2018bSimulink 9.2
9.6R2019aSimulink 9.32019Simulink Onramp; Schedule Editor;
9.7R2019bSimulink 10.0Toolstrip; Messages; Blockset Designer; Subsystem Reference
9.8R2020aSimulink 10.12020
9.9R2020bSimulink 10.2

See also[edit]

  • Simplorer

References[edit]

  1. ^'System Requirements and Platform Availability by Product'. mathworks.com. Retrieved 15 October 2015.
  2. ^'The Successful development process with MATLAB Simulink in the framework of ESA's ATV project'(PDF). Vega Group PLC. Archived from the original(PDF) on 2011-07-17. Retrieved 2011-11-01.
  3. ^'Model Based Design Accelerates the Development of Mechanical Locomotive Controls'. sae.org. Retrieved 28 June 2015.
  4. ^'Automatic Code Generation - Simulink Coder'. mathworks.com. Retrieved 28 June 2015.
  5. ^A Software Safety Certification Plug-in for Automated Code Generators: Feasibility Study and Preliminary Design
  6. ^BioAge Media. 'Green Car Congress: General Motors Developed Two-Mode Hybrid Powertrain With MathWorks Model-Based Design; Cut 24 Months Off Expected Dev Time'. greencarcongress.com. Retrieved 28 June 2015.
  7. ^Lotus Engineering Develops Control Systems Software to Reduce Diesel Emissions
  8. ^A Comparison of Three Code Generators for Models Created in SimulinkArchived 2010-08-11 at the Wayback Machine
  9. ^'Multitarget modeling reduces ECU software costs'. EETimes. Archived from the original on 18 October 2007. Retrieved 28 June 2015.
  10. ^'Code Generation - Embedded Coder - Simulink'. mathworks.com. Retrieved 28 June 2015.
  11. ^HDL Coder
  12. ^Cassandras, Christos (2007-11-27). 'Introduction to Discrete-Event Simulation'. Springer US. Archived from the original on 2013-02-02. Retrieved 2009-11-03.
  13. ^Mathworks. 'MatLab & Simulink: Simulink Reference R2015b'(PDF). Retrieved 28 September 2015.
  14. ^Mathworks (June 2009). 'list of version and release numbers for Simulink'. Retrieved December 14, 2010.
  15. ^'THE MATHWORKS ANNOUNCES SHIPMENT OF SIMULINK ON MICROSOFT WINDOWS'. thefreelibrary.com. Retrieved 28 June 2015.

External links[edit]

Retrieved from 'https://en.wikipedia.org/w/index.php?title=Simulink&oldid=1009139982'