message box in not working

4 ビュー (過去 30 日間)
Abdallah Shaltout
Abdallah Shaltout 2015 年 3 月 25 日
コメント済み: Abdallah Shaltout 2015 年 3 月 25 日
In the following simple code, the message box is not working:
prompt={'Enter the first number:','Enter the second number:'};
dlg_title='Data Input';
num_lines=1;
n=inputdlg(prompt,dlg_title,num_lines)
N1=str2num(n{1});N2=str2num(n{2})
c=N1+N2
message=num2str(c)
title='The sum'
msgbox(message,title,'error')
I have got the following error message
Index exceeds matrix dimensions.
Error in InOutBox (line 9)
msgbox(message,title,'error')

採用された回答

Guillaume
Guillaume 2015 年 3 月 25 日
Possibly, you have a variable in your workspace called msgbox. What does
which msgbox
returns?
Note that you may run into the same problem with your title variable if you try to use the title function.
  1 件のコメント
Abdallah Shaltout
Abdallah Shaltout 2015 年 3 月 25 日
Thanks Guillaume. Now it works.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by