Accessing Specific Data Field In Ground Truth Data

3 visualizzazioni (ultimi 30 giorni)
Matpar
Matpar il 20 Apr 2020
Commentato: Matpar il 5 Mag 2020
Hi All,
I have my goundtruth .mat file with some fields empty and I am trying to select data from only the rows and colums that contains data in all four fields!!
I am not certain how to start the code but i am guessing this is a for loop or rather a while loop!!
Here,s my take on this but it is wrong, I am learning and some day I will get this but I need to understand how to start this!
This is my code
Fullfields= 0;
while SDataTable(:,:) == []
Fullfields = (Fullfields + 1)
end
disp(Fullfields);
Can someone help me please!
Please see image of my task!
  2 Commenti
Matpar
Matpar il 23 Apr 2020
Hi Vinai Datta Thatiparthi and thanx in advance for responding,
I am tryin to automate this process by selecting data from the fields that is highlighted by the red arrows only!
The matfile is attached and thank you in advance once more!

Accedi per commentare.

Risposte (1)

Vinai Datta Thatiparthi
Vinai Datta Thatiparthi il 23 Apr 2020
Hey!
This should work -
data = load('Shooting.mat');
vals = data.Shooting.LabelData;
% Use cellfun to identify which elements within the timetable are empty
idx = all(~cellfun(@isempty,vals{:,:}),2);
% variable 'out' will contain only those rows which have all non-empty values
out = vals(idx,:)
Here's the Doc link for cellfun.
Hope this helps!
  3 Commenti
Matpar
Matpar il 5 Mag 2020
Thanx it really did! thank you loads, multi_tasking sorry for the later response

Accedi per commentare.

Categorie

Scopri di più su Function Creation in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by