- https://www.mathworks.com/help/matlab/matlab_env/files-and-folders-that-matlab-accesses.html
- https://www.mathworks.com/matlabcentral/fileexchange/20516-imagescnan-m-v2-1-aug-2009
After smoothly running this script all day yesterday, the command imagescnan stopped working. Also, note that the data files downloaded from NASA come as '.nc4.nc4'
3 views (last 30 days)
Show older comments
%My script:
P = ('/Users/USERNAME/Desktop/MERRA2_DATA/PrecipM2Data/MERRA2_100.tavgM_2d_lnd_Nx.198001.nc4.nc4');
lon = ncread(P, 'lon');
ncdisp(P, 'lon');
lat = flipud(ncread(P, 'lat'));
PPT = rot90(ncread(P, 'PRECTOTLAND'));
imagescnan (lon, lat, PPT)
set (gca, 'ydir', 'normal')
xlim([-180 180])
ylim ([-90 90])
title('1980 January')
colorbar
% Then I get the error:
Unrecognized function or variable 'imagescnan'.
Error in PrecipMERRA2_July (line 23)
imagescnan (lon, lat, PPT)
%It works with imagesc, just not imagescnan...
0 Comments
Answers (1)
Infinite_king
on 27 Sep 2023
Edited: Infinite_king
on 27 Sep 2023
Hi,
I understand that you are trying to use the ‘imagescnan’ function to read the data file, and it has been giving an error since the second day.
Possibly, the error might be occurring because the 'imagescnan' function is not on the MATLAB search path. The 'imagescnan' function is not a built-in function of MATLAB. Before using custom function files, you need to add their paths to the MATLAB search path. To fix the problem try placing ‘imagescnan.m’ file in the same folder as the main script file.
For more information on ‘imagescnan’ function and ‘MATLAB search path’ refer the following resources
Hope this is helpful.
0 Comments
See Also
Categories
Find more on NetCDF in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!