フィルターのクリア

Please im having this messeage displayed when using xlswrite function

27 ビュー (過去 30 日間)
Tijjani Aminu Kuda
Tijjani Aminu Kuda 2015 年 8 月 22 日
編集済み: Cedric 2015 年 8 月 22 日
Warning: Added specified worksheet. > In xlswrite>activate_sheet at 284 In xlswrite>ExecuteWrite at 256 In xlswrite at 213 In mainanalysis at 17

採用された回答

Cedric
Cedric 2015 年 8 月 22 日
編集済み: Cedric 2015 年 8 月 22 日
This is a warning that informs you that you are operating on a spreadsheet that doesn't exist, and hence adding it to the workbook. If you know that it is normal, you can disable this warning specifically as follows (put it before the call to XLSWRITE):
warning( 'off', 'MATLAB:xlswrite:AddSheet' ) ;
  2 件のコメント
Tijjani Aminu Kuda
Tijjani Aminu Kuda 2015 年 8 月 22 日
編集済み: Cedric 2015 年 8 月 22 日
Thank you.
But actually I want to saving data using for loop, with the loop iteration specifying the sheet number. it works for sometme then start giving me error: could not save in xlsx file rather in .csv file. attached is the programme.
close all;
clear all;
fs = 44100;
Ts= 1/fs;
N = 11025;
load F81.mat
for k1 = 1:20
m =F84(k1,:);
imf = emd(m);
for k = 1:length(imf)
b(k) = sum(imf{k}.*imf{k});
end
E = sum(m.^2);
sal = b/E;
filename = 'test.80.xlsx';
sheet = k1;
xlRange1 = 'B5';
xlswrite(filename,sal,sheet,xlRange1);
c = zeros(1,30);
for k = 1:30
r = corrcoef(m(1:N-k),m(1+k:end));
c(k) = r(1,2);
end
filename = 'test.80.xlsx';
sheet = k1;
xlRange2 = 'B15';
xlswrite(filename,c,sheet,xlRange2);
z = zeros(1,30);
for k = 1:30
z(k) = mai(m,k);
end
filename = 'test.80.xlsx';
sheet = k1;
xlRange3 = 'B25';
xlswrite(filename,z,sheet,xlRange3);
end
Cedric
Cedric 2015 年 8 月 22 日
編集済み: Cedric 2015 年 8 月 22 日
Is it still crashing if you replace all:
sheet = k1;
with
sheet = sprintf( 'Sheet%d', k1 ) ;
Note that, as Walter mentions below, it is very slow to access series of sheets using XLWRITE/XLSREAD.

サインインしてコメントする。

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2015 年 8 月 22 日
xlswrite() starts up and stops Excel every time. It is not suitable for using in a longer loop. I think I recall that Image Analyst has written that xlswrite() does not always clean up resources sufficiently so after enough calls it will start to fail (it might not be the fault of xlswrite, it might be activex.) xlswrite1() is offered as a solution; see above

カテゴリ

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