Error while evaluating UIControl Callback..
7 个评论
采纳的回答
I cannot find out, which is the line 1132. It is not useful to post such a huge code (without a proper formatting! Please read How to format code) and let the readers count lines to find the failing code.
I guess the problem is caused by something like this:
[rows columns] = size(Image);
Rimage = Image;
for y = 1:columns
for x = 1:rows
if (Rimage(x, y+1)==th1)
Now you try to process Rimage(x, y+1), when y=columns. Such an element does not exist, because Rimage does not have columns+1 columns.
You can use the debugger to check this. Type in the command window:
dbstop if error
Then run the code again until Matlab stops at the problem. Now check the values and sizes of the variables used in this line.
0 个评论
更多回答(1 个)
User posted the complete source in a different question. I cleaned it up and fixed some of the bugs and posted source at https://www.mathworks.com/matlabcentral/answers/396346-error-while-evaluationg-uicontrolm-callback#comment_559155
0 个评论
另请参阅
类别
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
