>>13856399First you need to edit the permission on the netcdf file. So do
ncid = netcdf.open('your_filename.nc','WRITE');
%then copy the vriables, for example
lat = ncread('your_filename.nc', 'lat');
lon = ncread('your_filename.nc', 'lon');
data = ncread('your_filename.nc', 'data_name_as_defined_in file');
%then close the netcdf, very important otherwise other people cannot open/edit the file
netcdf.close(ncid)