Data is not valid NDGRID format

7 次查看(过去 30 天)
Hi Matlab Community,
I'm a new user of Matlab program. I got the error when I used the griddedInterpolant function to interpolate the data, this error is displayed in the below.
In addition, I also attach my controlling script in this post.
Please help me to resolve this problem!
Any suggestions will be appreciated.
Thanks all,
Bests,
Manh,
Error using griddedInterpolant
Data is not valid NDGRID format
Error in
FCr = griddedInterpolant(daplon,fliplr(daplat),fliplr(hs),method);
  10 个评论
Scott MacKenzie
Scott MacKenzie 2021-6-4
Please re-read my comment. Posting "all your material" burdens anyone trying to help you with downloading, unzipping, importing multiple files, etc. I suggest you figure out a way to distill the issue down to something more manageable. It's usually best just to post a single spreadsheet or text data file and some code that accesses that data and demonstrates the issue you are trying to resolve.
Manh Nguyen
Manh Nguyen 2021-6-4
Hi Mr. Scott MacKenzie,
I've changed my script into one file which is attached in this post. And the error in my case is displayed like that:
>> run sample.m
xl =
80.3980
xr =
155.4010
yb =
-11.7401
yt =
33.5703
getting hs tp and dp for 20200601.0000
Error using griddedInterpolant
Data is not valid NDGRID format.
Error in sample (line 50)
FCr = griddedInterpolant(daplon,fliplr(daplat),fliplr(hs),method);
Error in run (line 86)
evalin('caller', [script ';']);
Can you kindly help me to resolve this problem?
Thank you very much!

请先登录,再进行评论。

采纳的回答

Walter Roberson
Walter Roberson 2021-6-4
If
FCr = griddedInterpolant(daplon,fliplr(daplat),fliplr(hs),method);
gives you that problem, then the first thing to try is
FCr = griddedInterpolant(daplon.',fliplr(daplat).',fliplr(hs).',method);
  16 个评论
Walter Roberson
Walter Roberson 2021-6-8
Adjusted versions of the files are attached.
Note the new function, read_with_retry . That is called by readww3_2TPAR2 in order to read each different variable more reliably.
This code has not been rewritten to try to read multipe timepoints at the same time. The guiding principle was "get it to work first!"
Manh Nguyen
Manh Nguyen 2021-6-9
Hi Roberson,
Thank you very much for your help.
I've downloaded and run your modified scripts and they can run successfully.
I'd like to say that I'm really appreciate your help.
Thank you again.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Downloads 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by