フィルターのクリア

How to remove the ">>" from my input statement?

1 回表示 (過去 30 日間)
Stephanie Velasco
Stephanie Velasco 2016 年 9 月 2 日
回答済み: Image Analyst 2016 年 9 月 3 日
so before, after running script, my input statement in matlab would appear as shown here " Enter the speed: " But recently it has been appearing like this " Enter the speed:>> ". Is there a way that I can prevent this ">>" from showing up?

回答 (2 件)

Star Strider
Star Strider 2016 年 9 月 2 日
The ‘>>’ is the Command Window input prompt. I use the inputdlg and other built-in GUI functions to keep from using the Command Window for inputs. They return cell arrays, so you have to write one further line of code to produce the appropriate string or numerical data from the cells, a small inconvenience for what I consider to be significantly increased utility.
  2 件のコメント
Stephanie Velasco
Stephanie Velasco 2016 年 9 月 2 日
oka, thank you so much for the help! I really appreciate it! I am going to try this out!
Star Strider
Star Strider 2016 年 9 月 2 日
As always, my pleasure!
The built-in GUIs make the essentials of interactive programming much easier.
You can use the other GUI capabilities to do more as you need to.

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


Image Analyst
Image Analyst 2016 年 9 月 3 日
Either you had it in your prompt like this:
s = input( 'Enter the speed:>> ', 's')
Or you didn't use input() and used something like fprintf() or sprintf().
I'd recommend using inputdlg() like Star recommended.

カテゴリ

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