You cannot change it directly. However, you can create a new layer with the existing/new values. Then, you can replace the existing layer with this new one.
Here is an example showing how to do that. In this example, we replace the TrainedMean and TrainedVariance of an existing BatchNorm layer with zeros and ones, respectively. Then, we replace the existing batchnorm layer with the new one. Assume here that the batchnorm layer number is 43 in the network layers and its name is 'bn_conv5_3'.
>> layer = setfield(setfield( net.Layers(43) , 'TrainedMean' , zeros(1,1,512)),'TrainedVariance',ones(1,1,512));
>> newlgraph = replaceLayer(net,'bn_conv5_3',layer);
Note that the replaceLayer function is only available in Matlab 2019a or higher. I faced a problem with the replaceLayer function, but hopefully it works with you.
Here is a complete example. Assume we have net_ that have some TrainedMean and TrainedVariance values which we want to copy to net BatchNorm layers.
for i = 1 : length(net.Layers)
L = setfield(setfield(net.Layers(i),'TrainedMean',net_.Layers(i).TrainedMean),'TrainedVariance',net_.Layers(i).TrainedVariance);
net = replaceLayer(net,net.Layers(i).Name,L);
net = assembleNetwork(net);
Remember that, you have to be very cautious with that because using improperly values from another network will give catastrophic results.