Hi,
I understand that you would like to replace the output layer consisting of 3 nodes to 4 nodes. You can do this by using the “replaceLayer” function.
After loading the pretrained network, you could do the following.
actorNetwork = replaceLayer(actorNetwork, 'Output', fullyConnectedLayer(4, 'Name', 'newOutput'));
Here I assume that actorNetwork is the pretrained Network which is loaded from the weights.mat file.
Hope this Helps!