Cell contents assignment to a non-cell array object.

Please find attached the program that contents all the parameters for the error programs
so this is the error that i get
Cell contents assignment to a non-cell array object.
Error in create_grid (line 60)
nw{'xl'} = ncdouble('one');
% Create variables and attributes
%
nw{'xl'} = ncdouble('one');
nw{'xl'}.long_name = ncchar('domain length in the XI-direction');
nw{'xl'}.long_name = 'domain length in the XI-direction';
nw{'xl'}.units = ncchar('meter');
nw{'xl'}.units = 'meter';
Error in make_grid (line 76)
create_grid(L,M,grdname,ROMS_title)
% Create the grid file
%
disp(' ')
disp(' Create the grid file...')
[M,L]=size(Latp);
disp([' LLm = ',num2str(L-1)])
disp([' MMm = ',num2str(M-1)])
create_grid(L,M,grdname,ROMS_title)
%

1 Commento

You did not include the code for make_grid or create_grid
romstools appears to refer to ROMS AGRIF Project . That project requires signing up to download the code.

Accedi per commentare.

 Risposta accettata

nw{'xl'} = ...
is not valid matlab syntax. Why are you indexing a cell array with a string?
Note that while
nw('xl') = ...
%or
[nw{'xl'}] = ...
may be valid matlab syntax, it's very unlikely that it is what you meant.

3 Commenti

It would still be invalid syntax. Curly braces indexing for a table requires two arguments: the rows and the columns. See here. Moreover, the indexing would have to return a scalar structure or object for the subsequent lines in the OP post to work.
There may be some toolbox object that overrides subsref for {} so that the original syntax works but without more info from the OP, it's not valid.
Finally it was just because I wasn't in the path, actually I included it but after doing "pw" I wasn't inside it so it maked matlab crash dont know why

Accedi per commentare.

Più risposte (0)

Categorie

Community Treasure Hunt

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

Start Hunting!

Translated by