MATLAB: Open (but no run) a *.m file via drag and drop – R2012b
command windowdrag and dropopen
Hello
How to modify the action "run" in "open" when you make a drag and drop of a *.m file in the "Command Window" ?
Thanks
Best Answer
I am not sure there is a documented way of doing that. But if you already have the editor open and if you drag it into the editor it will always open (not run).
As a workaround always keep a file open when you close MATLAB this way editor is always open and you can drag MATLAB files into it directly instead of the command line.
Mathworks has provided technical solution1-4DNMFD which gives code for dragging and dropping on a single figure. It works by using the figure ButtonDownFcn, WindowButtonUpFcn, and WindowButtonMotionFcn . The Motion function is used to detect the CurrentPoint and move the object to there.
Best Answer