From: tinne123 on
Hi folks,

is it true that xlswrite works with cell arrays? For me the following lines do not work, the critical range in the Excel sheet1 stays empty, whereas I get #N/A-s below which proves that ML writes something.

a = { 'NA', 'NA', 'NA'};
b = [3, 2, 1];
c = { a; b};
xlswrite(xlsname,c,1,'A2:C5'); % normally the range should be 'A2:C3'

Thanks for helping. I feel exhausted.
From: Walter Roberson on
tinne123 wrote:

> is it true that xlswrite works with cell arrays?

Only on Windows, if I recall correctly.
From: Steven Lord on

"tinne123 " <nastanova(a)yahoo.co.uk> wrote in message
news:ht6fhp$hh0$1(a)fred.mathworks.com...
> Hi folks,
>
> is it true that xlswrite works with cell arrays? For me the following
> lines do not work, the critical range in the Excel sheet1 stays empty,
> whereas I get #N/A-s below which proves that ML writes something.
>
> a = { 'NA', 'NA', 'NA'};
> b = [3, 2, 1];
> c = { a; b};
> xlswrite(xlsname,c,1,'A2:C5'); % normally the range should be
> 'A2:C3'
>
> Thanks for helping. I feel exhausted.

c is a cell array one of whose elements is itself a cell array, and that is
likely what is causing you trouble. Try this instead:

a = { 'NA', 'NA', 'NA'};
b = [3, 2, 1];
c = [a; num2cell(b)];
xlswrite(xlsname,c,1,'A2:C5');

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com


From: tinne123 on
Yes, that works fine. Thanks!