Data is not valid NDGRID format

7 Ansichten (letzte 30 Tage)
Manh Nguyen
Manh Nguyen am 3 Jun. 2021
Kommentiert: Manh Nguyen am 9 Jun. 2021
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 Kommentare
Scott MacKenzie
Scott MacKenzie am 4 Jun. 2021
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 am 4 Jun. 2021
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!

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 4 Jun. 2021
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 Kommentare
Walter Roberson
Walter Roberson am 8 Jun. 2021
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 am 9 Jun. 2021
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.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Downloads finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by