blob: 6ac8c670dc23f59faff2e3919ffb1a70a5033ebf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
function bagList=bagStructToList(bag)
if isstruct(bag)<> %T then
error(msprintf("Error: The input argument is not of type bagOfFeatures."));
end
fieldNamesActual=["FilePath";"VocabularySize";"StrongestFeatures";"Upright"];
fieldNamesInput=fieldnames(bag);
if fieldNamesActual <> fieldNamesInput then
error(msprintf("Error: The input argument is not of type bagOfFeatures, Wrong field names"));
end
bagList=list();
bagList(1)='bagOfFeatures';
bagList(2)=bag.FilePath;
bagList(3)=bag.VocabularySize;
bagList(4)=bag.StrongestFeatures;
bagList(5)=bag.Upright;
endfunction
|