input vector fra edit text in guide GUI

1 回表示 (過去 30 日間)
polo Mahmoud
polo Mahmoud 2020 年 2 月 25 日
コメント済み: polo Mahmoud 2020 年 2 月 25 日
I have used this code:
MVSENS=str2double(get(handles.edit27, 'String'))
it works fine for a single number like eg. 25, but i want to input a vector like this:
[1 2 3 4 5 6 ]
how do i do that from the edit text box in guide GUI

採用された回答

Adam
Adam 2020 年 2 月 25 日
編集済み: Adam 2020 年 2 月 25 日
sscanf( str, '%d' )
or
str2num( str )
would both work if the input is e.g. "1 2 3 4 5 6", although the first returns a column vector, but you can easily transpose it if you wish. The latter still works if you input "[1 2 3 4 5 6]" too.
  1 件のコメント
polo Mahmoud
polo Mahmoud 2020 年 2 月 25 日
thank you :D

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by