From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: ncread inside loop
Date: Thu, 06 Jun 2013 11:41:43 -0500
Organization: NNTP Server
Lines: 46
Message-ID: <koqe43$nq7$>
References: <kooa9o$3fm$> <koob5t$bo9$> <koqcic$a$>
Reply-To: <HIDDEN>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6
X-Notice: Filtered by postfilter v. 0.8.2
Xref: comp.soft-sys.matlab:796810

On 6/6/2013 11:15 AM, Jonathan W Smith wrote:
> Thanks for the response.
> the ncread function for netcdf files needs the
>actual characters of the name. ncread('', 'varname')

I do not know anything at all about ncread. But the file name is
there for you to use, it is in the struct returned back by dir().

> Once you have used dir to load the multiple files how do you
>load the actual filenames with the single quotes into ncread?

The file name is allready a string. Just use it as is. No need
to put '' around it.

EDU>> A=dir('*.eps');

4x1 struct array with fields:


EDU>> class(A(1).name)


>Is there a netcdf file command that reads in multiple netcdf files?

I do not know.

> This command allows you to do this: data_files = {'', ''} but,
>I have 44 files and do not want to write out 44 file names.

Have you thought about using a loop? You have the names in
the data returned by dir(), all what you have to do is make a loop
to read all your netcdf files.