LabKit MATLAB Workbench

reference

API ReferenceFramework Compatibility Contracts

labkit.contract.assertRequirements

Throw an error when LabKit API requirements are not met.

Syntax

labkit.contract.assertRequirements(appName, req) labkit.contract.assertRequirements(appName, req, versions)

Description

Calls checkRequirements and returns normally when every requirement is compatible. On failure, combines the individual report messages into one error. Use checkRequirements instead when incompatibility should be shown without throwing.

Inputs

appName
Text scalar used as the error-identifier prefix. It should be a valid MATLAB identifier, for example "labkit_Example_app".
req
Scalar structure returned by labkit.contract.requirements.
versions
Optional version structure array accepted by checkRequirements.

Outputs

None
Returns no value.

Errors

Throws <appName>:IncompatibleLabKit when compatibility checks fail. Input and range validation errors from checkRequirements are passed through.

Example

req = labkit.contract.requirements("app", ">=1 <2");
labkit.contract.assertRequirements("labkit_Example_app", req)

Source

This page is generated from the MATLAB help text in +labkit/+contract/assertRequirements.m.