GUIDE multiple images and variable handling

조회 수: 2 (최근 30일)
Colm
Colm 2011년 6월 29일
My GUI runs a script which takes a single video frame and saves it as an image. I run several calculations on the image. My problem is displaying the resulting variables in static textboxes and displaying the fft image in a different axes than the captured image.
So how do I redirect or display Variables in the GUI static textboxes instead of the command window?
Thanks
  댓글 수: 1
Krishna Kumar
Krishna Kumar 2011년 6월 29일
can you elaborate what problem you are facing.

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

채택된 답변

Walter Roberson
Walter Roberson 2011년 6월 29일
Best is to edit the code that outputs the variables to the command window.
If for some reason that is not possible, then evalc() that code, and then parse the resulting string to extract the values you want to put in to the GUI display.
  댓글 수: 1
Colm
Colm 2011년 6월 29일
Thank you,
The textboxes work now.

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

추가 답변 (2개)

Krishna Kumar
Krishna Kumar 2011년 6월 29일
The variables can be displayed using sprintf (assign sprintf output to the static text's string property). For plotting the fft in a separate axes, you can use 'axes(h)' to make the axes with handle 'h' the current axes. Then you can plot the fft as you want. What is your problem exactly?
  댓글 수: 1
Colm
Colm 2011년 6월 29일
The only problem i'm now having is display the my variable in textboxes on the gui itself. at the minute they r being displayed on the workspace.
Thanks again

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


Harry MacDowel
Harry MacDowel 2011년 6월 29일
I am not really clear too about the question.
Anyway, displaying answers on the static textbox should look like this:-
set(handles.yourstatictext1,'String',num2str(yourvariable)); Keep in mind that all static and editable textbox display strings.
  댓글 수: 3
Colm
Colm 2011년 6월 29일
Segment of the script file ran when a button is pressed:
imshow (Image);
vals = impixel;
Pixels = vals;
displayed (Pixels);
The variable 'Pixels' is displayed on the command window and not in a GUI static textbox. How can I either redirect or display them in the GUI?
Walter Roberson
Walter Roberson 2011년 6월 29일
Edit the code to instead
set(handles.yourstatictext1,'String',num2str(Pixels))

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

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by