function [THIS,NPATH,SSTATESUCCESS] = ...
    myupdatemodel(THIS,P,ASSIGNPOS,STDCORRPOS,OPT) %#ok<INUSD>

NPATH = 1;
SSTATESUCCESS = true;

assignnan = isnan(ASSIGNPOS);
ASSIGNPOS = ASSIGNPOS(~assignnan);
stdcorrnan = isnan(STDCORRPOS);
STDCORRPOS = STDCORRPOS(~stdcorrnan);

% Update regular parameters and run refresh if needed.
if any(~assignnan)
    THIS.Assign(1,ASSIGNPOS) = P(~assignnan);
end

% Update stds and corrs.
if any(~stdcorrnan)
    THIS.stdcorr(1,STDCORRPOS) = P(~stdcorrnan);
end

end