MATLAB Answers

An error when using the load command

1 view (last 30 days)
Hey all,
I hope you are safe and healthy. I have a little problem with reading a NetCDF from another directory rather than the current folder.
I typed this:
load ('F:\MATLAB Behzad\Datasets and codes\GPCC\precip.mon.total.v2018.nc')
but it gave me this error:
Error using load
Unknown text on line number 1 of ASCII file F:\MATLAB
Behzad\Datasets and codes\GPCC\precip.mon.total.v2018.nc
"HDF
".
My NetCDF is successfully open when I change the current folder to the F:\MATLAB Behzad\Datasets and codes\GPCC.
Any help?
Thank you all

  0 Comments

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 16 Mar 2020
You cannot load() a .nc file. You need to use something like ncread()

  1 Comment

Behzad Navidi
Behzad Navidi on 16 Mar 2020
Thank you. So:
cd 'F:\MATLAB Behzad\Datasets and codes\GPCC'
filename='precip.mon.total.v2018.nc'; %Name of netcdf file
then ncread.
Thanks again.

Sign in to comment.

More Answers (0)

Sign in to answer this question.

Tags

Products


Release

R2018b