function has = modelHasProfileAlready(profile, modelName)
            % Whether or not the specified profile is already imported into
            % the model. Note: Model must be open

            has = false;
            zcModel = systemcomposer.architecture.model.SystemComposerModel.findSystemComposerModel(modelName);
            if isempty(zcModel)
                return;
            end
            rootArch = zcModel.getRootArchitecture;
            profiles = rootArch.p_Model.getProfiles();
            names = arrayfun(@(x)x.getName, profiles, 'uniformoutput', false);
            has = any(strcmp(profile.getName(), names));
        end