The production of prompt $\Lambda^+_\mathrm{c}$ baryons is measured via the exclusive decay channel $\Lambda^+_\mathrm{c}$$\to$ pK$^-\pi^+$ at a center-of-mass energy per nucleon pair of 5.02 TeV, using proton-proton (pp) and lead-lead (PbPb) collision data collected by the CMS experiment at the CERN LHC. The pp and PbPb data were obtained in 2017 and 2018 with integrated luminosities of 252 and 0.607 nb$^{-1}$, respectively. The measurements are performed within the $\Lambda^+_\mathrm{c}$ rapidity interval $\vert y \vert$$\lt$ 1 with transverse momentum ($p_\mathrm{T}$) ranges of 3-30 and 6-40 GeV/$c$ for pp and PbPb collisions, respectively. Compared to the yields in pp collisions scaled by the expected number of nucleon-nucleon interactions, the observed yields of $\Lambda^+_\mathrm{c}$ with $p_\mathrm{T}$$\gt$ 10 GeV/$c$ are strongly suppressed in PbPb collisions. The level of suppression depends significantly on the collision centrality. The $\Lambda^+_\mathrm{c}$ / D$^0$ production ratio is similar in PbPb and pp collisions at $p_\mathrm{T}$$\gt$ 10 GeV/$c$, suggesting that the coalescence process does not play a dominant role in prompt $\Lambda^+_\mathrm{c}$ baryon production at higher $p_\mathrm{T}$.
The product of acceptance and efficiency ($A \epsilon$) as a function of $p_{\mathrm{T}}$ for prompt $\Lambda^+_c$ in pp collisions and within centrality regions of 0-90, 0-10, 10-30, 30-50 and 50-90% in PbPb collisions.
The $p_{\mathrm{T}}$ differential cross sections for prompt $\Lambda^+_c$ production in pp collisions. The global fit uncertainty is 8.6%.
The $\mathrm{T_{AA}}$-scaled $\Lambda^+_c$ yields as a function of $p_{\mathrm{T}}$ for PbPb collisions within centrality regions of 0-90, 0-10, 10-30, 30-50 and 50-90%.