Convert the code to parallel compute.The error says line 1:unable to perform assignment because the index on the left is not compatible with the size on the right.If I remove line 8 ,9,the program runs well.Can't I use loop variable i in parfor?
조회 수: 1 (최근 30일)
이전 댓글 표시
parfor i=100:1438
I=Im(:,:,i);
I = AnisotropicDiffusion(0.01,0.002,I);
[Ex,Ey] = gradient(I);
f = sqrt(Ex.*Ex+Ey.*Ey);
[u,v] = GVF(f, 0.08, 200);
mag = sqrt(u.*u+v.*v);
**px(i) = u./(mag+1e-10);
py(i) = v./(mag+1e-10);**
end
댓글 수: 0
답변 (1개)
Walter Roberson
2018년 10월 27일
We do not know the size of the variables returned by the function GVF, but the way the code is written implies that u and v are vectors. If they are then normalized u would be a vector but you are trying to store it in a scalar location.
참고 항목
카테고리
Help Center 및 File Exchange에서 Text Analytics Toolbox에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!