MATLAB: Undefined function ‘regexp’ for input arguments of type ‘double’

netcdf4regexp

Hello all,
I encountered this error message when reading .nc (netCDF4) files with MatLab R2015b. My script is,
%add path that relates to nc file: mexnc, snctools, netcdfAll-4.3.jar,netcdf_toolbox
test_snctools()
ncid = netcdf.open('/Users/YU-HSIN/Documents/VSDE/ACOS/acos_b34_L2lite_20090601_r03n.nc','NOWRITE');
nc_dump(ncid)
The error message showed
Undefined function 'regexp' for input arguments of type 'double'.
Error in snc_format (line 34)
if ~isempty(regexp(theFile,'https*://', 'once'))
Error in snc_read_backend (line 49)
fmt = snc_format(ncfile);
Error in nc_info (line 49)
[backend,fmt] = snc_read_backend(ncfile);
Error in nc_dump (line 101)
info = nc_info(file_name);
Error in COprofile (line 13)
nc_dump(ncid)
I do not know how to solve this question. I am new to MatLab. Does anyone know? Thanks a lot!

Best Answer

You appear to be obtaining nc_dump from some outside package that is not compatible.
There is a File Exchange Contribution that has an ncdump (no underscore) but no nc_dump on the Mathworks site.
You might be able to use the MATLAB ncdisp() instead.