There are many ways that you can implement this workaround, and the following is one example. This example uses MiKTeX from https://miktex.org/ as the TeX application. It also uses a user-contributed function, teximage.m, which can be found on MATLAB Central at the following URL:
https://www.mathworks.com/matlabcentral/fileexchange/1231-teximage-m
This function will convert a LaTeX string into an image and display it in a figure. It can also return the 3D color matrix required for the 'CData' property mentioned earlier. When using this function to generate the 'CData', you will have to pay attention to the optional input parameter, 'resolution', which defines the font resolution. This will help you to obtain the appropriately sized 3D color data matrix that will fit in the button. NOTE: Some font resolutions are not supported and will produce an error.
Provided that you have MiKTeX installed and have put teximage.m on your MATLAB path, You can use the following example as a guide for this workaround:
texstr = 'Process: $\bar{x} = \beta \times \sqrt{x+1}$';
I = teximage('-noHG',texstr, ...
'displaymode','none', ...
'background',get(0,'defaultuicontrolbackgroundcolor'), ...
'resolution',100,'antialias','off');
hpb = uicontrol('cdata',I,'units','pixels','position',[100 100 175 30])