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: softthresh_proxA_cha.m
    path of file: ./repos/CS_MoCo_LAB/reconstruction/matlab/CS_LAB_matlab/utils/utils_Proximal
    
    the code of the file until where you have to start completion: function [x_cell_thresh] = softthresh_proxA_cha(x_cell,threshold,nCha,waveS,groupnorm_index)
% softthresholding combined with proximal average of wavelet tree structre
% note: calculation is equal to x/|x| (|x| - threshold)+  == x (1 - threshold/|x|)+
%
% (c) Marc Fischer, Thomas Kuestner

    
function [x_cell_thresh] = softthresh_proxA_cha(x_cell,threshold,nCha,waveS,groupnorm_index)
% softthresholding combined with proximal average of wavelet tree structre
% note: calculation is equal to x/|x| (|x| - threshold)+  == x (1 - threshold/|x|)+
%
% (c) Marc Fischer, Thomas Kuestner
% ---------------------------------------------------------------------

length_x = size(x_cell{1,1},2);
maxlvl_st = waveS(1,1)*waveS(1,2)+1;
maxlvl_end