Code covered by the BSD License  

Highlights from
viewProfiles

image thumbnail
from viewProfiles by Brandon Armstrong
GUI to examine horizontal and vertical cuts through a 3D data set or 2D matrix.

myIsField (inStruct, fieldName)
function isFieldResult = myIsField (inStruct, fieldName)
% inStruct is the name of the structure or an array of structures to search
% fieldName is the name of the field for which the function searches
isFieldResult = 0;
f = fieldnames(inStruct(1));
for i=1:length(f)
    if(strcmp(f{i},strtrim(fieldName)))
        isFieldResult = 1;
        return;

    elseif isstruct(inStruct(1).(f{i}))
        isFieldResult = myIsField(inStruct(1).(f{i}), fieldName);
        if isFieldResult
        return;

        end
    end
end

Contact us