validate
Class: target.Object
Namespace: target
Validate data integrity of target feature object
Syntax
myTargetFeature.validate()
Description
myTargetFeature.validate()
runs a procedure to
validate the data integrity of the object myTargetFeature
. If the
validation procedure fails, the method produces an error.
Examples
Validate Hardware Device Data
To validate the data integrity of target objects, use the IsValid
property or the validate
method of the target.Object
base class.
Consider an example where you create a target.Processor
object and associate an existing language implementation with the object.
myProcessor = target.create("Processor"); myProcessor.LanguageImplementations = target.get("LanguageImplementation", ... "ARM Compatible-ARM Cortex");
To see that the newly created object is not valid, enter myProcessor.IsValid
.
myProcessor.IsValid
ans = logical
0
If you try to validate the object with the method myProcessor.validate()
, you get an error.
myProcessor.validate()
Error using target.internal.Processor/validate Target data validation failed. * Undefined property "Name" in "Processor" object. * Undefined identifier in "Processor" object.
The validation fails because these target.Processor
properties are not specified:
Name
— Processor nameId
— Object identifier
You can specify a processor name, which also specifies the object identifier.
myProcessor.Name = "MyProcessor";
Check the validity of myProcessor
again to see that the validity of the object is established.
myProcessor.IsValid
ans = logical
1
myProcessor.validate()
Note: When you use the target.add
function to register a target object, the software also checks the validity of the object.
Version History
Introduced in R2019b
See Also
Comando de MATLAB
Ha hecho clic en un enlace que corresponde a este comando de MATLAB:
Ejecute el comando introduciéndolo en la ventana de comandos de MATLAB. Los navegadores web no admiten comandos de 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)