Hi...I got some issue here,i get "undefined function or variable matlab 'sout'. The first class assignment to a local variable determine its class"
1 view (last 30 days)
Show older comments
ching linnkee
on 23 May 2016
Commented: ching linnkee
on 24 May 2016
I keep trying to solve but still can't. Some buddy can help me solve this? I appreciate your advice !
1 Comment
Accepted Answer
Walter Roberson
on 24 May 2016
t0 = 60;
imgmin = 0;
imgmax = 0;
imgmin = min(img(:));
imgmax = max(img(:));
th = t0 + (imgmin + imgmax)./2;
sout = zeros(size(img));
sout = img > th;
More Answers (1)
Image Analyst
on 23 May 2016
Replace the whole function contents with this:
t0 = 60;
threshold = t0 + (max(img(:)) + min(img(:))) / 2;
sout = img > threshold;
See Also
Categories
Find more on Logical in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!