Probe data from a field in a structure
Show older comments
Hello,
I have a structure that contains 6 fields. One of these fields is called 'frames'. 'frames' contains 3500 one dimensional arrays. I want to know if any one of these arrays contains the number 1 or the number 1092. How would I determine this?
Thanks so much,
Joseph Rubin
Answers (2)
madhan ravi
on 4 Jun 2020
Counts = nnz(ismember(STRUCt.frames,[1,1092]))
1 Comment
Joseph Rubin
on 4 Jun 2020
darova
on 13 Jun 2020
try this
n = numel(sportEvents1);
ind = false(n,1);
for i = 1:numel(sportEvents1)
if any( ismember(sportEvents1(i).frames,[1 1092]) )
ind(i) = true;
end
end
Categories
Find more on Structures in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!