On 6/25/2013 4:09 PM, Mary wrote:
...
colHeader = {'Number Full Completion', ...
'Number Partial Completion Less than Five', ...
'Number Partial Completion Less than Ten', ...
'Number Partial Completion More than Ten', ...
'Number No Login'};
stats(1) = totalCompleted;
stats(2) = partialUnderFive;
stats(3) = partialUnderTen;
stats(4) = partialOverTen;
%% Saves Data into an xls spreadsheet
saveName = ['Module_Status_Report' date]
xlswrite(saveName,log,1)
xlswrite(saveName,stats,2,'A2')
xlswrite(saveName,colHeader,2,'A1')
>>
>> I've never used xlswrite() so no help there, really, sorry...
...
But, as a followup, I did the following
>> colHeader = {'Number Full Completion', ...
'Number Partial Completion Less than Five', ...
'Number Partial Completion Less than Ten', ...
'Number Partial Completion More than Ten', ...
'Number No Login'};
>> stats=randperm(100); stats=stats(1:5)
stats =
80 56 49 48 76
>> xlswrite('xlswr.xls',stats,2,'A2')
>> xlswrite('xlswr.xls',colHeader,2,'A1')
And all seemed as expected. I then shortened stats to have only four
entries and cleared the A2:A5 in case that were somehow a problem
>> stats(5)=[];
>> xlswrite('xlswr.xls',stats,2,'A2')
>>
Still as expected.
Then tried as combined
xlswrite('xlswr.xls',{colHeader;stats},2,'A2')
Didn't work; the cell array is complex...have to have a cell array that
is each cell a single entity for xlswrite() to handle it.
If debugging on the above doesn't bring nirvana you might try the
alternate outputs from xlswrite and see what, if any, error message(s)
are generated as klews...
OTOMH looks like what you have should be ok. Nothing like you've got
password protection on the sheet or something, is it???

