how to save the varname contains different characters (attached) as a cell array format using GUI in matlab ?

1 Ansicht (letzte 30 Tage)
Below is the code displaying the variables inside the loop. How to save these displayed variables as a cell format using GUI in matlab?
for varid=0:nvars-1
[varname, xtype(i,:), dimids, numatts(i,:)] = netcdf.inqVar(ncid(i,:),varid);
disp(['--------------------< ' varname ' >---------------------'])
end
  4 Kommentare
Geoff Hayes
Geoff Hayes am 10 Apr. 2016
Manoj - please clarify what you mean as cell format. Do you wish to save the data to a mat file or a text file or something else? Please describe the format of the file.
Manoj
Manoj am 11 Apr. 2016
Geoff Hayes
I need to save the data to a mat file The format of the file is attached please see.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 11 Apr. 2016
for varid=0:nvars-1
[varname, xtype(i,:), dimids, numatts(i,:)] = netcdf.inqVar(ncid(i,:),varid);
outstring{varid+1} = ['--------------------< ' varname ' >---------------------']);
end
[outfile, outpath] = uiputfile('*.mat');
if ischar(outfile)
%if the user did not cancel
filename = fullfile(outpath, outfile);
save(filename, 'outstring');
end

Weitere Antworten (0)

Kategorien

Mehr zu Data Import and Analysis 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