MATLAB:输入确认输入对话框?
我知道有一种方法可以使键盘上的 Enter 键确认 inputdlg() 对话框,请参见此处: http://www.mathworks.de/support/solutions/en/data/1-39UWQT/index.html?product=ML&solution=1-39UWQT
好吧,这是一个解决方法,问题是,我必须将它存储在 matlab 目录中(因为正如页面上所述:“由于它依赖于几个私有函数,newid.m 仅当存储在这个目录中时才起作用位置。”).. 现在的问题是,我想编写一个不依赖于 Matlab 目录中的用户更改的代码,因为缺少权限...是否还有另一种(可能是肮脏的)方法来实现此行为?
谢谢!
I know there's a way to make the enter-key on the keyboard confirm the inputdlg() dialog, see here:
http://www.mathworks.de/support/solutions/en/data/1-39UWQT/index.html?product=ML&solution=1-39UWQT
Okay it's a workaround, the problem is, I have to store it in the matlab directory (because as said on the page: "Since it is dependent on several private functions, newid.m will only work if stored in this location.").. The problem now is, I want to make a code which doesn#t rely on user changes in the Matlab directory because of missing privileges... Is there still another (perhaps dirty) way to achieve this behaviour?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
解决方案:
inputdlg()
的文件夹;您可以通过which inputdlg
找到它(例如 C:\Program Files\MATLAB\R2011b\toolbox\matlab\uitools\inputdlg.m)private
-子目录并复制两个文件getnicedialoglocation.m
和setdefaultbutton.m
并将它们粘贴到newid.m
所在的项目文件夹中位于。现在使用newid()
而不是inputdlg()
调用所有输入对话框Solution:
newid.m
from http://www.mathworks.de/support/solutions/en/data/1-39UWQT/index.html?product=ML&solution=1-39UWQT to a arbitrary folder, e.g. into your projects folderinputdlg()
is stored; you can find this out viawhich inputdlg
(e.g. C:\Program Files\MATLAB\R2011b\toolbox\matlab\uitools\inputdlg.m)private
-subdirectory and copy the two filesgetnicedialoglocation.m
andsetdefaultbutton.m
and paste them into your project's folder where thenewid.m
is located. Now call all your input dialogs by usingnewid()
instead ofinputdlg()