Hi Arnub,
The m_map package is not supported by MATLAB. But to write into reprojected netcdf files you can use this as an example :
[x, y] = m_ll2xy(longitude, latitude);
% Create new NetCDF file
ncid = netcdf.create('reprojected_file.nc', 'CLOBBER');
% Define dimensions
dimid_x = netcdf.defDim(ncid, 'x', size(x, 2));
dimid_y = netcdf.defDim(ncid, 'y', size(y, 1));
% Define variables
varid_lat = netcdf.defVar(ncid, 'latitude', 'double', dimid_y);
varid_lon = netcdf.defVar(ncid, 'longitude', 'double', dimid_x);
varid_var = netcdf.defVar(ncid, 'variable', 'double', [dimid_y dimid_x]);
% Write data to variables
netcdf.putVar(ncid, varid_lat, lat);
netcdf.putVar(ncid, varid_lon, lon);
netcdf.putVar(ncid, varid_var, variable);
For more information on netcdf please refer to:
For more information on m_map please refer to:
Hope this helps!
Thanks
Balaji