I want to read 2 nc files which containing soil moisture as variable, but when readin the given code ,it showing some error
Mostrar comentarios más antiguos
file1= 'path of the file1'
file2='path of file2'
sm= ncread(file1,'sm') ;
sm=ncread (file2,'sm') ;
8 comentarios
Walter Roberson
el 26 de Mayo de 2023
What error do you observe?
Jincy
el 26 de Mayo de 2023
Walter Roberson
el 26 de Mayo de 2023
It does not say anything like "Subscript out of range", or "unknown function or variable ncread"?
Walter Roberson
el 26 de Mayo de 2023
Which MATLAB release are you using? ncread() needs R2011a or later.
Jincy
el 28 de Mayo de 2023
Walter Roberson
el 28 de Mayo de 2023
Is the error message being shown at the call to ncread(), such as
Unrecognized function or variable 'ncread'.
or is the error message being created inside ncread(), such as a message about the file not being readable?
Please show the exact error message(s)
Jincy
el 28 de Mayo de 2023
Walter Roberson
el 28 de Mayo de 2023
As far as I can tell, ncread is part of basic MATLAB in R2022a, so you should not be told that it is unrecognized.
Exception: if you just happened to have named a variable ncread somewhere inside the function, then even if the variable had been clear or had not been initialized yet, MATLAB would decide that ncread is not a function reference inside the function.
If you are not using ncread as a variable somewhere inside the function, then try
rehash toolboxcache
Also please show us the result for
which -all ncread
Respuestas (1)
KSSV
el 26 de Mayo de 2023
file1= 'path of the file1' ; % path with ame of file
file2='path of file2' ; % path with name of file
sm1= ncread(file1,'sm') ;
sm2=ncread (file2,'sm') ;
Categorías
Más información sobre Biological and Health Sciences en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!