You can write the values which you want to plot in a ‘mat file’ and load the mat file formed in the App Designer Code and proceed further by referring the “UIAxes” to generate a 3D plot on it.
Try executing this code by adding “startupFcn” callback in App Designer, which gives a 3D plot on the “UIAxes” added in “UIFigure”.
[X,Y] = meshgrid(1:0.5:10,1:20);
Z = sin(X) + cos(Y);
save ( 'variables.mat' , 'X' , 'Y' , 'Z');
In App Designer startupFcn callback method: