how to save the varname contains different characters (attached) as a cell array format using GUI in matlab ?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Manoj
el 7 de Abr. de 2016
Respondida: Walter Roberson
el 11 de Abr. de 2016
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 comentarios
Geoff Hayes
el 10 de Abr. de 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.
Respuesta aceptada
Walter Roberson
el 11 de Abr. de 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
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Data Import and Analysis en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!