Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
netcdf reading in stand-alone applications

Subject: netcdf reading in stand-alone applications

From: Arseny Kubryakov

Date: 14 Dec, 2010 15:52:07

Message: 1 of 4

Dear all!

I read netcdf files with netcdf toolbox as

sl= netcdf('nrt_global_merged_msla.nc','nowrite');

It works ok

But! When I create a stand-alone application with MCR the programm didn't work

It writes

Error in ==> ncmex at 139

Error in ==> netcdf.open at 20

Error in ==> netcdf.netcdf at 416

Error in ==> test_errors_nc at 4

MATLAB:UndefinedFunction

I try to copy netcdf.dll into programm folder, but .exe file didn't work!

Please help me!
Respect!

Subject: netcdf reading in stand-alone applications

From: Carlos Alberto

Date: 20 Dec, 2010 20:02:06

Message: 2 of 4

I have the same problem! Did you find any solution??

Best Regards!

Subject: netcdf reading in stand-alone applications

From: TideMan

Date: 20 Dec, 2010 21:16:27

Message: 3 of 4

On Dec 15, 4:52 am, "Arseny Kubryakov" <arsk...@gmail.com> wrote:
> Dear all!
>
> I read netcdf files with netcdf toolbox as
>
> sl= netcdf('nrt_global_merged_msla.nc','nowrite');
>
> It works ok
>
> But!  When I create a stand-alone application with MCR the programm didn't work
>
> It writes
>
> Error in ==> ncmex at 139
>
> Error in ==> netcdf.open at 20
>
> Error in ==> netcdf.netcdf at 416
>
> Error in ==> test_errors_nc at 4
>
> MATLAB:UndefinedFunction
>
> I try to copy netcdf.dll into programm folder, but .exe file didn't work!
>
> Please help me!
> Respect!

I don't know what MCR means.
But if you can read a .nc file using netcdf, you should be able to
write one like this:
nc=netcdf(ncfile,'clobber');
nc.description='Database of historical p, u, and v from NOAA''s GFS
model';
nc.date=datestr(now,'dd-mmm-yyyy');
etc

Please describe exactly how you created and inserted data into
your .nc file.

Did you try ncdump on your .nc file?

Subject: netcdf reading in stand-alone applications

From: Arseny Kubryakov

Date: 21 Dec, 2010 09:27:38

Message: 4 of 4

TideMan <mulgor@gmail.com> wrote in message
> I don't know what MCR means.
> But if you can read a .nc file using netcdf, you should be able to
> write one like this:
> nc=netcdf(ncfile,'clobber');
> nc.description='Database of historical p, u, and v from NOAA''s GFS
> model';
> nc.date=datestr(now,'dd-mmm-yyyy');
> etc
>
> Please describe exactly how you created and inserted data into
> your .nc file.
>
> Did you try ncdump on your .nc file?

This functions work very good in Matlab, the problems begin when you're trying to create stand-alone application with Matlab.

>I have the same problem! Did you find any solution??

>Best Regards!

I just find alternative one. I use cdo program to transform netcdf to ascii ( https://code.zmaw.de/projects/cdo)
The code is: dos(['cdo outputcenter ' fname ' > ASCII_FILE.txt']);

But then you need to reshape files in special way.
Not the very nice solution, but at least it works.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us