필터 지우기
필터 지우기

Diplaying values in GUI

조회 수: 2 (최근 30일)
Rob
Rob 2012년 4월 27일
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

채택된 답변

Sean de Wolski
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
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.
Rob
Rob 2012년 4월 27일
I just had it working and read your answer.
Is what I did, I included the calculation in the DisplayVAlues function. In fact,I wrote a code that does various processing to the image. When representing them in a GUI it is not as straight forward as putting each process in diffent callback function.
So my question is how do I link the result of one function to
the next one? i.e:
1st function: I read 1st image and apply so stuff to it, I extract parameters,
2nd function: use the above parameters and apply them to another image,
3rd function: call for a 3rd image and run some convolution the above too image
ect ...
Many thanks for your help!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Geometric Transformation and Image Registration에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by