Reputation: 73
I have written code for an object counter based on color using a webcam. Now the final values are three integers: r
, b
, and g
.
I need to display those values in three edit text boxes.I did this by using the following:
r=get(handles.rcount,'string');
(my algorithm)
r=r+1;
set(handles.rcount,'string',r);
Now when I execute the program, it starts with 0, and the next value it displays is 49, even though I increment by only 1. How do I fix this?
Upvotes: 2
Views: 2240
Reputation: 4477
You need to convert r to a string before setting it on the edit box. See functions like num2str or int2str. char(49) is 1.
Upvotes: 3