Using regexp on a double array
2 次查看(过去 30 天)
显示 更早的评论
I'm trying to extract variable names and years from my file names, but getting an error from regexp.
Example of code:
%Call up files
pwd
fuf(pwd, 'detail');
fn=fuf(['/Users/katharynwoods/Documents/MATLAB/Research/MATLAB/flux_sensitivity_analysis/Met_drivers/sens_heat/*shtfl.nc*'],'detail');
load(char(fn{1}));
%Extract variable names
pieces = regexp(fn, '\/', 'split');
p=pieces{1};
driver = p{9};
but I get this error message:
Undefined function 'regexp' for input arguments of type 'double'.
Is there a different function I should be using on double arrays? Thanks!
9 个评论
per isakson
2013-6-25
编辑:per isakson
2013-6-25
Matlab (R2012a) does not have a function, load, which reads NetCDF-files.
Doc says: ncdisp, Display contents of NetCDF data source in Command Window
Try
ncdisp( '[...]alysis/Met_drivers/sens_heat/shtfl.1902.nc') % use full name
and read the documentation on NetCDF
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 File Operations 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!