One way to achieve that would be to create a new file with the existing schema (structures, dimensions, variables and attributes) of old files using "ncwriteschema".
Then you can write data to this newly created file using "ncwrite".
https://www.mathworks.com/help/matlab/ref/ncwrite.html