Info
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
why am i getting this error-Characters adjacent to a ** wildcard must be file separators.
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
>
- > %%%%% CODE TO EXTRACT TRMM DATA GRID WISE TO GENERATE TIME SERIES OF RAINFALL DEPTH AT 3 HR INTERVAL
- %%%%% BINDHU V M
- %TO LOAD ALL THE FILES
- dirpath=('D:\trmm2\todel\');
- files=dir('D:\trmm2\todel\3B**');
- nfiles=length(files);
- datadir = 'D:\trmm2\todel\';
- fname = '3B42.20071105.12.7A.SUB.nc';
- lat1 = ncread([datadir,fname],'latitude');
- lon1 = ncread([datadir,fname],'longitude');
- %%%% TO EXTRACT THE DATA FOR INDIVIDUAL GRIDS
- mydata=[];
- for i=1:nfiles
- filename=[dirpath files(i).name];
- disp(['Processing ',files(i).name]);
- rain=ncread(filename,'pcp');
- dd=flipud(rain');
- c1=reshape(dd',13664,1);
- mydata=[mydata c1];
- end
- data1=mydata';
- % data1=data*3;
- %%%% TO GENERATE TEXT FILES WITH TIME SERIES OF rainfall intensitiy GRIDWISE
- for ii=1:13664
- textfilename=['precip' num2str(ii) '.txt'];
- fid1=fopen(textfilename,'wt');
- fclose(fid1);
- end
- for iii=1:13664
- c=data1(:,iii);
- precip=c(:,:);
- textfilename=['precip' num2str(iii) '.txt'];
- fid1=fopen(textfilename, 'at+');
- fprintf(fid1, [repmat('%d\t', 1, size(precip,2)) ''],precip');
- fclose(fid1);
- end
- Error using dir
- Characters adjacent to a wildcard must be file separators.
1 comentario
Respuestas (1)
OCDER
el 20 de Jun. de 2018
The error message seems pretty clear. Characters adjacent to a wildcard must be file separators.
files=dir('D:\trmm2\todel\3B**'); %ERROR. You have a "3B" next to "**".
files=dir('D:\trmm2\todel\3B*'); %OK. This will find all folders (not files) starting with 3B
files=dir('D:\trmm2\todel\3B*.*'); %OK. This will find all files in todel folder matching the 3B*.* format
0 comentarios
La pregunta está cerrada.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!