how to save the varname contains different characters (attached) as a cell array format using GUI in matlab ?
조회 수: 1 (최근 30일)
이전 댓글 표시
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
Geoff Hayes
2016년 4월 10일
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.
채택된 답변
Walter Roberson
2016년 4월 11일
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
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Import and Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!