You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: UPVRobotGenerateMeasurementPoints.m
    path of file: ./repos/A-Lab/include/Measurements/Special Research - UPV Robot/Methods
    
    the code of the file until where you have to start completion: function UPVRobotGenerateMeasurementPoints(app)
% Copyright (C) Jose M. Requena Plens 
% joreple@upv.es - jmrplens.github.io

% Check if posible generate points
if strcmp(app.ExtUI.UPVRobotGeneratemeasurementpointsButton.Enable,'off')

    
function UPVRobotGenerateMeasurementPoints(app)
% Copyright (C) Jose M. Requena Plens 
% joreple@upv.es - jmrplens.github.io

% Check if posible generate points
if strcmp(app.ExtUI.UPVRobotGeneratemeasurementpointsButton.Enable,'off')
    return;
end

% Loading info
d = uiprogressdlg(app.ALabUIFigure,'Title','Loading...',...
    'Indeterminate','on');

% ====================================================
% Parameters

% SizeRobot
XLen = app.ExtVar.UPVRobot.XLen;
YLen = app.ExtVar.UPVRobot.YLen;
ZLen = app.ExtVar.UPVRobot.ZLen;

switch app.ExtVar.UPVRobot.CoordsType
    
    case 'Auto'
        % =======================================================================
        
        % Resolution
        XRes = app.ExtVar.UPVRobot.XRes;
        YRes = app.ExtVar.UPVRobot.YRes;
        ZRes = app.ExtVar.UPVRobot.ZRes;
        
        % Origin-End
        XOri = app.ExtVar.UPVRobot.XOri;
        XEnd = app.ExtVar.UPVRobot.XEnd;
        YOri = app.ExtVar.UPVRobot.YOri;
        YEnd = app.ExtVar.UPVRobot.YEnd;
        ZOri = app.ExtVar.UPVRobot.ZOri;
        ZEnd = app.ExtVar.UPVRobot.ZEnd;
        
        
        % ====================================================
        % Array points
        % X
        if XEnd==0 || XRes==0
            arrX = 0;
        else
            arrX = linspace(XOri,XEnd,XRes);
        end