I'm dealing with Simulink Design Verifier and want to extract some information on my own. Therefore, I want to count the number of Objectives and how much of them have been satisfied.
'Objectives' is a struct itself: Objectives<1x10 struct>
Counting the number of objectives is easy:
length(fieldnames(Objectives))
The content of 'Objectives' are also structs. Each such struct has the following content:
type
status
label
Now I want to count how many elements in 'Objectives' satisfy the property
'status == Satisfied'
Assuming that you have an array of structs, use the following code:
If you have old Matlab version, you can use:
You could also use ISMEMBER. Example:
Note how I am performing case-insensitive comparison by using LOWER function.