Diplaying values in GUI
2 次查看(过去 30 天)
显示 更早的评论
Hello,
I am creating my first simple GUI using matlab in which I uplaod an image, calculte its max R, G, B values and display them. I have a load push botton which works fine and a second one for calculating the maximum R,G and B values. What I want to do is to have the values displayed in three separate 'static text'buttons and below the callback function i used:
function DisplayValues_Callback(hObject, eventdata, handles)
set(handles.Rvalue, 'string',Rmax);
set(handles.Gvalue, 'string',Gmax);
set(handles.Bvalue, 'string',Bmax);
Unfortunately, it did not work, anyone can help me out please. Thank you very much. Remy
0 个评论
采纳的回答
Sean de Wolski
2012-4-27
Rmax, Gmax and Bmax have to be strings. If the are represented as numbers, use num2str() to convert to string:
doc num2str
and
set(handles.Bvalue, 'string',num2str(Bmax));
3 个评论
Image Analyst
2012-4-27
WHERE are they calculated? If they aren't calculated inside that function, they won't be seen. Please copy the error message (all the red text) so we can see what "didn't work" means. I suspect it will say Rmax is undefined.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!