GUI Warning: Directory not founded

1 回表示 (過去 30 日間)
Ethar Alkamil
Ethar Alkamil 2019 年 2 月 28 日
コメント済み: Ethar Alkamil 2019 年 2 月 28 日
For the GUI edit1 window:
name = get(handles.edit1,'string');
For the pushbutton window:
global name
cd 'C:\Users\Alex\Documents\MATLAB\Projects'
mkdir(name)
I got the following warning,
Warning: An empty directory name was given. No directory will be created.
This syntax may not be supported in future releases.
I tried different solutions but all of them not working,
Please help

採用された回答

Adam
Adam 2019 年 2 月 28 日
Don't use global variables. They are very unreliable. Just share data between callbacks instead. It's anyone's guess what might have set the global name variable between whenyou think you set it to what you want and when you try to use it. It's not even obvious from the code snippet you gave whether you are declaring it as global in the first place or retrieving it as global when you try to use it. Without both a global variable will not work.
  1 件のコメント
Ethar Alkamil
Ethar Alkamil 2019 年 2 月 28 日
Got it,
Thanks

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSearch Path についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by