function has = fmuHasProfileAlready(profileName, fmuName)
% Whether or not the specified profile is already imported into
% the fmu.

%   Copyright 2023 The MathWorks, Inc.

    zcModel = systemcomposer.architecture.model.SystemComposerModel.findFMUSystemComposerModel(fmuName);
    rootArch = zcModel.getRootArchitecture;
    profiles = rootArch.p_Model.getProfiles();
    names = arrayfun(@(x)x.getName, profiles, 'uniformoutput', false);
    has = any(strcmp(profileName, names));
end
