function varargout = struct2nc_test
%struct2nc_test test for  struct2nc
%
% note that char and cellstr are both returned as nx1 cellsstr
%
%See also: struct2nc

ncfile = 'tst.nc';
delete(ncfile)
D0.row      = [1 2 3];
D0.col      = [1 2 3]';
D0.matrix   = ones(3);

D0.cellstr  = {'aap','noot','mies'};
D0.char     = char(D0.cellstr);

struct2nc(D0,ncfile)

% - nc2struct writes char & cellstr  as char, nc2struct reads them as nx1 cellstr, so 
%   nc2struct and nc2struct are not fully inverses of one another.
D1 = D0;
D1.cellstr = cellstr(D1.cellstr)';
D1.char    = cellstr(D1.char);

D2 = nc2struct(ncfile);

OK = isequalwithequalnans(D1,D2);

varargout = {OK};
