I think you are pretty close from what I can see.
The properties of the app are kept as variables and can be obtained from any callback or function.
I would therefore wait a few lines to set the app.UITable.Data value until you have updated your 'data' variable in the UploadButtonPushed
function UploadButtonPushed(app, event)
app.filename=[path file];
app.UITable.ColumnName = data.Properties.VariableNames;
data.Properties.VariableNames{1}='Load mass';
data.Properties.VariableNames{2}='RBB';
data.Properties.VariableNames{3}='LBB';
data.Properties.VariableNames{4}='RES';
data.Properties.VariableNames{5}='LES';
x = table2array(data(:,"Load mass"));
y = table2array(data(:,"RBB"));
y2=table2array(data(:,"LBB"));
y3=table2array(data(:,"RES"));
y4=table2array(data(:,"LES"));
And then I'd refrain from loading data again in the other callbacks by reusing the data from the table
function PlotButtonPushed(app, event)
x = table2array(data(:,"Load mass"));
y = table2array(data(:,"RBB"));
y2=table2array(data(:,"LBB"));
y3=table2array(data(:,"RES"));
y4=table2array(data(:,"LES"));
plot(app.UIAxes,x,y,x,y2,x,y3,x,y4);
title(app.UIAxes, 'Load Mass vs ALL')
xlabel(app.UIAxes, 'Load Mass')
ylabel(app.UIAxes, 'All')
legend(app.UIAxes,'RBB','LBB','RES','LES');
And similarly the MPButtonPushed as (unless you define x, y, R etc. as public properties and access them by app.x rather than x, which would be slightly more efficient)
function MPButtonPushed(app, event)
x = table2array(data(:,"Load mass"));
y = table2array(data(:,"RBB"));
y2=table2array(data(:,"LBB"));
y3=table2array(data(:,"RES"));
y4=table2array(data(:,"LES"));
m = sum((x - themean).*(y- themean1));
p = sum((x - themean).*(x - themean));
m2 = sum((x - themean).*(y2 - themean2));
m3 = sum((x - themean).*(y3 - themean3));
m4 = sum((x - themean).*(y4 - themean4));
c = categorical({'RBB','LBB','RES','LES'});
xlabel(app.UIAxes, 'Type')
ylabel(app.UIAxes, 'Cycle')
bar(app.UIAxes, c, [l1;l2;l3;l4],'LineWidth',0.4);
You could make several minor optimisations e.g. by adding a filter to your uigetfile and by adding a StartUpFcn to disable the Plot and MP buttons until you have loaded data, but that's just bells and whistles - I think the above code will implement your minimum requirements