Reduce computing time of these code

조회 수: 1 (최근 30일)
Jason
Jason 2016년 3월 4일
편집: Walter Roberson 2016년 3월 4일
The following code takes 98.5% computing time of a script. Is there any code can be rewritten to improve time efficiency?
[m,n]=size(Master)
[m_sub,n_sub]=size(a)
for i=1:m_master
result(1:m_sub,i)=strcmp(Text(i,1),a(1:m_sub,2))
end
[row,col]=find(result)
b_sorted=transpose(Data(col,1:n))
b_txt_sorted=Text(col,1)
clear m_sub n_sub row col result i
  댓글 수: 1
KSSV
KSSV 2016년 3월 4일
편집: Walter Roberson 2016년 3월 4일
  1. result is not initialized
  2. in result the number 1:m_sub is same, but you are mentioning it all time.
  3. What to find? [row, col] = find(result) ??
More I can comment knowing what's the data is.

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

답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by