Subscript indices must either be real positive integers or logicals.
Mostra commenti meno recenti
Hi,
dist = sqrt((r1 - r2) ^ 2 + (c1 - c2) ^ 2);
costs(i) = 1 /ceil( dist) * exp(- abs(ceil(img(abs(r1), abs(c1))) - ceil(img(abs(r2),abs(c2)))) ^ 2 / (2 * sigma ^ 2));
c2 is equal to 0 ,so it returns Subscript indices must either be real positive integers or logicals.
Thanks
Risposta accettata
Più risposte (1)
Azzi Abdelmalek
il 9 Mag 2016
Check if abs is not used as a variable in your code. You can check by writing
whos abs
You can resolve the problem by typing
clear abs
abs(c2)
2 Commenti
sbei arafet
il 9 Mag 2016
Azzi Abdelmalek
il 9 Mag 2016
You don't think, but have you tried to check it buy typing?
which abs
clear abs
abs(0)
Categorie
Scopri di più su Image Processing Toolbox in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!