Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MATLAB: Enter to confirm input-dialog?

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!

like image 890
tim Avatar asked Nov 05 '22 07:11

tim


1 Answers

Solution:

  1. Copy the 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 folder
  2. Go into the folder where the original inputdlg() is stored; you can find this out via which inputdlg (e.g. C:\Program Files\MATLAB\R2011b\toolbox\matlab\uitools\inputdlg.m)
  3. Go into the private-subdirectory and copy the two files getnicedialoglocation.m and setdefaultbutton.m and paste them into your project's folder where the newid.m is located. Now call all your input dialogs by using newid() instead of inputdlg()
like image 180
tim Avatar answered Nov 09 '22 13:11

tim