PartoftheNewStimpackage[GOOD,ERRORMSG]=vlt.data.hasAllFields(VARIABLE,FIELDNAMES,FIELDSIZES)CheckstoseeifVARIABLEhasallofthefieldnamesinthecellstrFIELDNAMESandalsocheckstoseeifthevaluesofthosenamesmatchthedimensionsgiveninthecellarrayFIELDSIZES.Ifyoudon't care to analyze one dimension, pass -1 for that dimension. For example,r=struct('test1',5,'test2',[61]);s=struct('test1',5,'test3',[61]);[g,e]=vlt.data.hasAllFields(r,{'test1','test2'},{[11],[12]})givesg=1,e=''.
[g,e]=vlt.data.hasAllFields(s,{'test1','test2'},{[11],[12]})givesg=0,e=['''test2'''notpresent.']Ifyoudidn't care how many columns the test2 field of r was, then you couldpass[1-1]insteadof[12],orifyoudidn't care what size it was at all then you could pass [-1 -1]. Note: At present, this function does not work on arrays of structs, only structs. As a work-around, pass the first element of a struct array to see if it is good.