getting the data from the inputdlg box

10 ビュー (過去 30 日間)
Max
Max 2012 年 2 月 25 日
編集済み: Matt J 2013 年 10 月 25 日
I have the following codes ..where i have given two variables
  1. distance of sensor from system
  2. Set point in mm
prompt={'Enter the distance of sensor from system',...
'Enter the set point in mm:'};
name='Input of control system';
numlines=1;
defaultanswer={'45','125'};
answer=inputdlg(prompt,name,numlines,defaultanswer);
Now when i use these codes value of both the variables are stored in the variable answer..
when in workspace i type following things happen
>> answer
'45'
'125'
here its a cell ..but i want to use it as an input by user without cell..
suggest a way to perform this

採用された回答

Walter Roberson
Walter Roberson 2012 年 2 月 25 日
There is no way to do that in MATLAB without creating a temporary variable (such as "answer") to hold the values. Once the temporary variable is created, you can use (for example)
[sensdist, setpoint] = answer{:};
  1 件のコメント
Max
Max 2012 年 2 月 25 日
thanks walter it worked.....thanks so much

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by