How to speed up the xlswrite in for loop
Show older comments
In my project, I have 166 different type of character set is there, Each character set have 280 images. For each character I got 140 feature extracted data. I am try to store this data in excel sheet. I am using this code. It works but it takes too much time like 150 hours to execute. How to speed up this code, My code is
B=[267; 279; 278; 271; 258; 258; 263; 269; 240; 266; 271; 249; 272; 264; 277; 271; 265; 272; 279; 268; 269; 272; 262; 273; 274; 268; 274; 280; 277; 264; 272; 277; 268; 277; 270; 275; 269; 270; 259; 276; 270; 266; 274; 279; 278; 270; 266; 276; 270; 277; 270; 274; 269; 272; 271; 279; 278; 277; 276; 278; 268; 268; 270; 270; 268; 266; 273; 256; 268; 271; 270; 277; 256; 276;
259; 276; 262; 269; 272; 269; 268; 261; 260; 273; 274; 275; 264; 276; 269; 276; 268; 268; 261; 256; 270; 279; 265; 260; 269; 258; 257; 263; 258; 276; 267; 269; 266; 274; 277; 270; 269; 261; 257; 259; 273; 272; 275; 270; 263; 274; 278; 274; 266; 269; 269; 259; 268; 272; 260; 278; 265; 268; 262; 273; 274; 278; 272; 267; 267; 270; 252; 238; 265; 258; 266; 275; 269; 271; 277; 280; 273; 276; 264; 265; 275; 275; 275; 264; 271; 266; 271; 266; 258; 264; 264; 254];
for i=1:166
x =cell(1,B(i));
f1=cell(1,B(i));
f2=cell(1,B(i));
cellRef_0 = sprintf('A1');
xlswrite('telugu_41-50.xls',i,i,cellRef_0);
for j=1:B(i)
cellRef1 = sprintf('B%d:CH%d',j,j);
cellRef2 = sprintf('CI%d:EK%d',j,j);
x{j} = imread(sprintf('E:/apps/project/TELUGU data/telugu sep/%d/ (%d).jpg',i,j))
f1{j} = feature_extractor(x{j});
f2{j} = feature_extractor_2d(x{j});
xlswrite('telugu_41-50.xls',f1{j},i,cellRef1);
xlswrite('telugu_41-50.xls',f2{j},i,cellRef2);
end
end
load handel
sound(y,Fs)
1 Comment
KSSV
on 27 May 2016
consider writing it in csv file. It could be faster then xlswrite.
Answers (1)
Walter Roberson
on 27 May 2016
0 votes
Categories
Find more on Spreadsheets in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!