https://ch.mathworks.com/help/images/ref/rgb2lin.html
rgb2lin - Linearize gamma-corrected RGB values - MATLAB
This MATLAB function undoes the gamma correction of the sRGB values in image A so that B contains linear RGB values.
gammacorrectedrgbvaluesmatlab