MATLAB Answers


How to save a Cell array as excel file and give it a name

Asked by Hello kity on 4 Jan 2013


I have a cell array, containing strings and numeric values.

I would like to save that as xls file, and give the user the option to choose the name.

I thought of these but dont know how exactly:

%program  name code

or you should be able to do it with uiputfile, but how can i determine the input (DATA).

[FileName,PathName] = uiputfile('*.xls','Save file','C:\Work.xls');



No products are associated with this question.

1 Answer

Answer by Walter Roberson
on 4 Jan 2013
 Accepted answer

[FileName,PathName] = uiputfile('*.xls','Save file','C:\Work.xls');
fname = fullfile(PathName, FileName);
xlswrite(fname, TheNameOfYourCellArrayGoesHere)


Join the 15-year community celebration.

Play games and win prizes!

Learn more
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!