필터 지우기
필터 지우기

How to speed up the xlswrite in for loop

조회 수: 1 (최근 30일)
sukhesh chukkapalli
sukhesh chukkapalli 2016년 5월 27일
답변: Walter Roberson 2016년 5월 27일
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
KSSV
KSSV 2016년 5월 27일
consider writing it in csv file. It could be faster then xlswrite.

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

답변 (1개)

Walter Roberson
Walter Roberson 2016년 5월 27일

카테고리

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