フィルターのクリア

Problems with actxserver function for xlswrite?

2 ビュー (過去 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 Center および File ExchangeSpreadsheets についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by