필터 지우기
필터 지우기

Problems with actxserver function for xlswrite?

조회 수: 4 (최근 30일)
Kristian Vepsäläinen
Kristian Vepsäläinen 2014년 8월 11일
답변: Ken Atwell 2014년 8월 14일
I have error: Undefined function 'actxserver' for input arguments of type 'char'. I use iMac (late 2009) and OSX 10.9.4. Matlab is 2014a (student) and I try write Excel-files using xlswrite. So, how I can write to Excel-files?

답변 (2개)

Iain
Iain 2014년 8월 11일
I am guessing that since you're using an iMac, that you don't have windows installed, and that may explain why you do not have the option of using an activex server.
Do you have excel on that machine? If so, you might be able to use DDE methods (ddepoke, ddeinit, ddeexec) to send commands (and data) to an open excel application. You may need to understand VBA to do it though.
Another answer to your question is to use CSV files.
fopen, fwrite/fprintf and fclose will be what you need to use to do that, e.g.
fid = fopen('blah.csv','w');
fwrite(fid,uint8(['Hello, duckies, are you feeling well?' 10 13 '45, 23, 76, 235, 12345' 10 13]),'uint8');
fwrite(fid,uint8(['Goodbye, No I am dead., I told you i was sick.' 10 13 '454, 234, 476, 45, 1235']),'uint8');
fclose(fid);
  댓글 수: 3
Kristian Vepsäläinen
Kristian Vepsäläinen 2014년 8월 11일
I use next function with writing to Excel:
function kirjoitus(polku, kirjoitettava)
if exist('G:\TUTKIMUS\Tulokset')
asema = 'G:\TUTKIMUS\Tulokset\';
elseif exist('E:\TUTKIMUS\Tulokset')
asema = 'E:\TUTKIMUS\Tulokset\';
elseif exist('/Volumes/KINGSTON/TUTKIMUS/Tulokset')
asema ='/Volumes/KINGSTON/TUTKIMUS/Tulokset';
elseif exist('/Users/aadmin/Documents/MATLAB/TUTKIMUS/')
asema ='/Users/aadmin/Documents/MATLAB/TUTKIMUS/';
else
asema='X:\Tutkimus\Tulokset\';
end
tayspolku=[asema polku];
[kork,lev]=size(kirjoitettava);
kirjoitettava=kirjoitettava(1:kork,1:lev);
xlswrite(tayspolku,kirjoitettava,'Sheet1','A2');
end
So, could you tell me, how this must change that I can write to CSV-file?
Image Analyst
Image Analyst 2014년 8월 11일
Use the 'dir' option in your call to exist().
Use csvwrite() or dlmwrite() instead of xlswrite().

댓글을 달려면 로그인하십시오.


Ken Atwell
Ken Atwell 2014년 8월 14일
XLSWRITE is only fully support on Windows; on a Mac, try WRITETABLE or CSVWRITE instead.

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by