octcdf

David Bateman David.Bateman at motorola.com
Mon Sep 1 10:31:06 CDT 2008


Andres Sepulveda wrote:
>   Hi,
>
>   I have a code which searchs for a specific dimension inside a NetCDF file.
>
> nc=netcdf(fname,'write');
> tlen =  length(nc('tclm_time'));
> tlen
> if tlen==0
>   tlen=1;
> end
>
> but is the file doesn't has that field it stops with the following error
>
> error: Error while querying dimension tclm_time: NetCDF: Invalid
> dimension ID or name
> error: evaluating argument list element number 1
>
> is there a way the variable tlen would just become 0, rather than to
> give that error message?
>
>  Regards,
>
>     Andres
> _______________________________________________
> Help-octave mailing list
> Help-octave at octave.org
> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
>
>   

nc=netcdf(fname,'write');
try
  tlen = length (nc('tclm_time'));
catch
  tlen = 0;
end
if tlen== 0
  ten =1;
end

-- 
David Bateman                                David.Bateman at motorola.com
Motorola Labs - Paris                        +33 1 69 35 48 04 (Ph) 
Parc Les Algorithmes, Commune de St Aubin    +33 6 72 01 06 33 (Mob) 
91193 Gif-Sur-Yvette FRANCE                  +33 1 69 35 77 01 (Fax) 

The information contained in this communication has been classified as: 

[x] General Business Information 
[ ] Motorola Internal Use Only 
[ ] Motorola Confidential Proprietary



More information about the Help-octave mailing list