Borrar filtros
Borrar filtros

Diplaying values in GUI

2 visualizaciones (últimos 30 días)
Rob
Rob el 27 de Abr. de 2012
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

Respuesta aceptada

Sean de Wolski
Sean de Wolski el 27 de Abr. de 2012
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 comentarios
Image Analyst
Image Analyst el 27 de Abr. de 2012
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 el 27 de Abr. de 2012
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!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Geometric Transformation and Image Registration en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by