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: ch_gpsls.m
    path of file: ./repos/nav_matlab/lib/gnss
    
    the code of the file until where you have to start completion: function [X, dx, G] = ch_gpsls(X,  sat_pos,  pr)
% GPS 伪距最小二乘法求解， 状态量为 X Y Z B(钟差)
% X: X 值(1:3) 位置delta, (4) 用户钟差偏差
% G: 设计矩阵

    
function [X, dx, G] = ch_gpsls(X,  sat_pos,  pr)
% GPS 伪距最小二乘法求解， 状态量为 X Y Z B(钟差)
% X: X 值(1:3) 位置delta, (4) 用户钟差偏差
% G: 设计矩阵
% pr: 校正后的伪距
% sat_pos: 卫星位置矩阵
% delta: delta 值(1:3) 位置delta, (4) 用户钟差偏差

B1=1;
END_LOOP=100;
%卫星个数
n = size(sat_pos, 2);

if n < 4
    dx = 0;
    G = 0;
    return
end