フィルターのクリア

Show value of an array in a messagebox

8 ビュー (過去 30 日間)
KFrenkie
KFrenkie 2015 年 10 月 29 日
コメント済み: KFrenkie 2015 年 10 月 29 日
Hi,
I would like to display a value of an array in a messagebox.. However it comes with alot of white space.
e.g.
msgbox(num2str(variable1(4,4))) gives:
Who has the answer to this probably "super" easy question ;)!

採用された回答

TastyPastry
TastyPastry 2015 年 10 月 29 日
msgbox() doesn't give you a lot of options with the formatting. If you want to move the text to the right, you can add an icon.
msgbox(data,title,icon);
Otherwise, you're better off creating your own figure and putting UI elements into it. For example, if you were to create a small figure and put the value and an OK button:
fig = figure('position',[350 350 150 150]);
data = uicontrol('style','text','units','normalized','string',num2str(myData),...
'horizontalalignment','center','position',[.4 .2 .6 .2]);
button = uicontrol('style','pushbutton','units',normalized','string','OK','position',[.4 .1 .2 .1]);
Then, you can just set the button callback to close the figure or something.
  1 件のコメント
KFrenkie
KFrenkie 2015 年 10 月 29 日
Thanks!
I changed it to a figure :)!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by