How to fill and write nc file?

Hi all,
I try to extract some variables from my model's data and put in new file.
I can read and extract data from nc file and create new nc file but in filling the variable I have faced problems.
Is it possible to help me?
My code is:
fname = char('output.nc');
............................................
lon = ncread(fname,'lon');
lat = ncread(fname,'lat');
velocity = ncread(fname,'velocity');
...........................................
nccreate("myexample.nc","lat")
>> nccreate("myexample.nc","lon")
>> nccreate("myexample.nc","velocity")

1 Commento

Mihir
Mihir il 27 Giu 2023
Can you please share the error which you encountered when filling the variable.

Accedi per commentare.

Risposte (1)

JAVAD
JAVAD il 27 Giu 2023

0 voti

Error in ncwrite (line 87)
ncObj.write(varName, varData, start, stride);

Categorie

Scopri di più su Data Import and Analysis in Centro assistenza e File Exchange

Tag

Richiesto:

il 27 Giu 2023

Risposto:

il 27 Giu 2023

Community Treasure Hunt

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

Start Hunting!

Translated by