Export/save data into excel in matlab 2014a...
이전 댓글 표시
xlswrite('someting.xls',data) make error i.e
Warning: Could not start Excel server for export.
XLSWRITE will attempt to write file in CSV format.
but when i use csvwrite it make an error i.e:
Error using dlmwrite (line 112)
The input cell array cannot be converted to a matrix.
in matlab 2008b this type of error doesn't come: need your help i am tired...
댓글 수: 8
Geoff Hayes
2014년 7월 31일
Are you running MATLAB through Windows or something else? I get that same error when I run the line of code on my Mac...which makes sense. See this link xlswrite on mac, which while three years old, may still be relevant.
azizullah khan
2014년 7월 31일
Eric
2014년 7월 31일
Stupid question, but: Do you have Excel installed?
Assuming you do, what happens when you try:
xlsobj = actxserver('Excel.Application');
xlsobj.Visible = true;
azizullah khan
2014년 7월 31일
Geoff Hayes
2014년 7월 31일
What is your data? A matrix, cell array, etc. What are the dimensions of the object?
Geoff Hayes
2014년 7월 31일
Try the following: in the Command Window type
open xlswrite
This will open the xlswrite.m file in the MATLAB Editor. Put a breakpoint at line 83 (which should be the first line of code). Now back in the Command Window, type
xlswrite('someting.xls',data)
Once you execute this command, the debugger will be enabled within the Editor and the execution should be paused at the line of your breakpoint. Now just step through each line, pressing the Step button (to right of Continue button) until you get to the line 171 which is
Excel = actxserver('Excel.Application');
(Alternatively, just put a breakpoint here.) If this fails, for whatever reason, the subsequent catch block
catch exception %#ok<NASGU>
warning(message('MATLAB:xlswrite:NoCOMServer'));
prints out the warning message that you have observed. What would be interesting though is nature of the exception. While still debugging the code, and presumably you are now within the catch block with the warning message been printed out, in the Command Window type
exception
which is the MException object input to the catch block. When I type this value and press enter, I see
exception =
MException with properties:
identifier: 'MATLAB:UndefinedFunction'
message: 'Undefined function 'actxserver' for input arguments of type 'char'.'
cause: {}
stack: [1x1 struct]
What do you see when you do the same?
azizullah khan
2014년 8월 1일
Geoff Hayes
2014년 8월 1일
I'm confused. In my initial comment, I as asked you whether you were running MATLAB on Windows or something else, and you responded with i am using on my pc. So where are you experiencing this problem - on the PC or on the Mac?
What is a poi library? What do jar files have to do with xlswrite?
답변 (1개)
Image Analyst
2014년 8월 1일
0 개 추천
Are you sure you have full blown Excel and not a "starter version" which is installed free on some new computers. The starter version will not respond to ActiveX commands.
I don't think csvwrite takes cell arrays. Certainly not those with mixed numbers and strings. Evidently it thinks you have a cell array and is trying to call cell2mat on it and it's failing, probably because you have mixed class content in your cells.
If you can start Excel via ActiveX, then use xlswrite1() in the File Exchange to write your cell array. http://www.mathworks.com/matlabcentral/fileexchange/10465-xlswrite1
댓글 수: 2
azizullah khan
2014년 8월 1일
Image Analyst
2014년 8월 1일
Sorry, I know nothing about MATLAB on the mac. I don't even know what a poi library file is. I'll put "mac" in the tags for you though. Good luck.
카테고리
도움말 센터 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!