I Have a value of bwarea, how can I get this value and show in edit text in my GUI?

조회 수: 1 (최근 30일)
Example:
EDITOR: bwarea(a)
COMMAND WINDOW: ans = 10 % (I need to show this value in my edit text GUI)
anybody help me? thanks!!!

채택된 답변

Walter Roberson
Walter Roberson 2017년 11월 12일
set(handles.text1, 'String', num2str(bwarea(a)) )
  댓글 수: 3
Image Analyst
Image Analyst 2017년 11월 12일
Or, if you have a recent version of MATLAB you can use OOP syntax:
area = bwarea(a);
handles.text1.String = sprintf('The area = %.1f pixels', area);
Marlon Damaceno
Marlon Damaceno 2017년 11월 12일
Yes! I have the last version 2017b. It works too! Thank you Image Analyst!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 App Building에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by