- result is not initialized
- in result the number 1:m_sub is same, but you are mentioning it all time.
- What to find? [row, col] = find(result) ??
Reduce computing time of these code
1 次查看(过去 30 天)
显示 更早的评论
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
2016-3-4
编辑:Walter Roberson
2016-3-4
More I can comment knowing what's the data is.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Dialog Boxes 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!