From cc14ed2c0801e615e6fa84dbeb2984c402d002f1 Mon Sep 17 00:00:00 2001 From: Jacques Grelet <jacques.grelet@ird.fr> Date: Mon, 7 Jan 2008 07:45:31 +0000 Subject: [PATCH] work with all csv files --- @tsg_nc/get_fieldnames.m | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/@tsg_nc/get_fieldnames.m b/@tsg_nc/get_fieldnames.m index 0349aab..64ed143 100644 --- a/@tsg_nc/get_fieldnames.m +++ b/@tsg_nc/get_fieldnames.m @@ -1,10 +1,10 @@ function result = get_fieldnames( self ) -% tsg_ncvar/get_fieldnames -- get internal fieldnames of "tsg_ncvar" object. +% tsg_nc/get_fieldnames -- get internal structure fieldnames of "tsg_nc" object. % % Input % ----- -% self ........... an instance of 'tsg_ncvar' object +% self ........... an instance of 'tsg_nc' object % % Output % ------ @@ -12,7 +12,14 @@ function result = get_fieldnames( self ) % $Id$ -theStruc = get(self,'DAYD'); -result = fieldnames(theStruc); - +% get cell of keys inside object +% ------------------------------ +c = get(self); +if isempty(c) + warning('Empty object') ; +else + % get structure for the first element + theStruc = get(self,c{1}); + result = fieldnames(theStruc); +end -- GitLab