Info

此问题已关闭。 请重新打开它进行编辑或回答。

loop vectorization for below code

1 次查看(过去 30 天)
vivek
vivek 2014-11-19
关闭: MATLAB Answer Bot 2021-8-20
Hi, I was wondering if there is a fast way to vectorize this code.
idx_A=1; idx_B=1; idx_C = 1;
for idx=1:length(temp)
if ~image(x(idx),y(idx))==0
lA(idx_A)= handles.Val(idx);
idx_A=idx_A+1;
end
if handles.Morph.Threshold_MapFrame(x(idx),y(idx))==0.5
lB(idx_B)= handles.Val(idx);
idx_B=idx_B+1;
end
if handles.Morph.Threshold_MapFrame(x(idx),y(idx))>0.5
lC(idx_C)= handles.Val(idx);
idx_C=idx_C+1;
end
end

回答(0 个)

此问题已关闭。

标签

Community Treasure Hunt

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

Start Hunting!

Translated by