Prev: MNRFIT Error "Undefined function or method 'mnrfit' for input arguments of type 'double'"
Next: Trimesh contour plot with nans
From: tinne123 on 21 May 2010 13:23 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 21 May 2010 14:28 tinne123 wrote: > is it true that xlswrite works with cell arrays? Only on Windows, if I recall correctly.
From: Steven Lord on 21 May 2010 15:11 "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 21 May 2010 16:19
Yes, that works fine. Thanks! |