PROBLEM WITH SAVING EXCEL FILE ?

I am using the following code to save the name of file as a number but it does not save ? Help please !!
S_data{1} = input('Type in your number '); %Uses cell force string grouping %printout to excel
S_data{2} = input('Type in your age '); S_data{3} = input('Type in your gender ', 's');
sNumber= S_data{1}; %Collects subject's number sAge= S_data{2}; %Collects subject's age sGender= S_data{3}; %Collects subject's gender
filename = sprintf ('%s_Excel_File.xlsx', sNumber); % Specifies excel file xlswrite(filename,S_data,1,'A1'); %Writes to excel about the number, data included %sheetnumber, cell to start A1

Respuestas (1)

Mischa Kim
Mischa Kim el 17 de Feb. de 2014
Editada: Mischa Kim el 17 de Feb. de 2014
Shanky, use strcat instead
filename = strcat(num2str(sNumber),'_Excel_File.xlsx');

Etiquetas

Preguntada:

el 17 de Feb. de 2014

Editada:

el 17 de Feb. de 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by