Display calculation of GUI in text box
4 ビュー (過去 30 日間)
古いコメントを表示
I'm trying to display a calculation my code does into a textbox in my GUI. For example:
htextbox1 = uicontrol('Style','text','String','area','Position',...
[150,220,100,30]);
set(htextbox1,'Visible','Off')
r = 0;
x = 2;
y = 4;
r = x^2 + y^2;
if r ~=0
set(htextbox1,'Visible','On')
set(htextbox1,'String',num2str(r))
end
and I want the textbox to display the value of r. How can I do this? Nothing I've tried works. Thanks.
1 件のコメント
回答 (1 件)
Walter Roberson
2015 年 10 月 20 日
Your exact code works for me when pasted into my command window.
One thing I would recommend is that you use Units when you give the Position parameter.
参考
カテゴリ
Help Center および File Exchange で Genomics and Next Generation Sequencing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!