Error using fclose Invalid file identifier.
Mostrar comentarios más antiguos
Hi Matlab's Community,
I'm a new user of Matlab. I'm practicing my program, but I got the error:
Error using fclose
Invalid file identifier. Use fopen to generate a valid file identifier.
Error in nc_interface (line 98)
fclose(fid);
Error in nc_getatt (line 61)
[method,~,~] = nc_interface(ncfile);
Error in nc_inq (line 69)
A = nc_getatt(ncfile); % NetCDF file global attributes
Error in get_roms_grid (line 98)
Ginfo = nc_inq(Ginp);
Error in coarse2fine (line 59)
C = get_roms_grid(Ginp);
Error in wrf2roms_mw_ref (line 26)
coarse2fine(ParROMSFile,theROMSFile,eval(num2str(pgratio)),eval(num2str(pistart)),eval(num2str(piend)),eval(num2str(pjstart)),eval(n str(pjend)))
Error in generate_roms_grid (line 123)
[rho,projection] =
wrf2roms_mw_ref(theWRFFile,theROMSFile,rlim,npass,order,mini_depth,bathy_source,mod_dom,corr_ocean_mask,num_passes)
Error in run (line 86)
evalin('caller', [script ';']);
Please help me to resolve this problem. I'm really appreciated that.
I'm really sorry because it's quite specific.
Thanks all.
Respuesta aceptada
Más respuestas (1)
KSSV
el 17 de Dic. de 2021
0 votos
You need not to use fopen and fclose etc for reading ncfiles in MATLAB. Reading ncfiles is very simple in MATLAB. You just need to know two functions: ncinfo/ ncdisp and ncread. Read about these functions.
1 comentario
Manh Nguyen
el 17 de Dic. de 2021
Categorías
Más información sobre NetCDF en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!