what should i do when i click on button i want to show the value of variable in axes
2 次查看(过去 30 天)
显示 更早的评论
i declare a variable and want to show its value when user click on button what should i do? my code is
function pushbutton5_Callback(hObject, eventdata, handles)
global mor
cc = bwconncomp(mor,4);
number = cc.NumObjects;
no i want to show the value of number?
any method?suggest me please.
Walter Roberson expecting some help from you.
0 个评论
采纳的回答
Walter Roberson
2016-5-2
text(X, Y, num2str(number))
for appropriate X and Y coordinates.
However, since the number does not relate to any one object, consider something like
title(sprintf('There were %d objects', number))
5 个评论
Walter Roberson
2016-5-3
Please post the complete text of the error message, and also the current version of your function.
It would also be better if you rewrote to avoid using global variables. See
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Interactive Control and Callbacks 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!