MATLAB Answers

Drag and Drop file (txt file)

23 views (last 30 days)
cemsi888
cemsi888 on 5 Feb 2015
Answered: Xiangrui Li on 28 Jun 2016
Hi every one . I want to make drag and drop box. Could you give me advices about that. My target is: I took text files from our experiments and than i want to drag and drop it into command window.After that i want to control my calculations , plot diagrams etc... As you expected i have too many Experiment results and i want to make my calculations succesively thats why i need drag and drop box. how can i create it ?and how can i link Buttons with m files.

  6 Comments

Show 3 older comments
Michael Haderlein
Michael Haderlein on 5 Feb 2015
From your answer I suppose what you describe as command window is not the Command Window of the Matlab desktop? What might come close to your needs is uigetfile(). This opens the standard file select dialog. I don't know a real drag and drop solution. Maybe here you can find something.
cemsi888
cemsi888 on 5 Feb 2015
yes you are rihgt it is not matlab command window.and do you know how can i add Status bar in my "COMMAND WINDOW"?
Michael Haderlein
Michael Haderlein on 5 Feb 2015
Just create axes at this position and a patch in there. Set xlim to [0 1] and update the xdata of the patch over progress:
figure, ha=axes('xlim',[0 1],'ylim',[0 1],'xtick',[],'ytick',[],'box','on');
hp=patch([0 0 0 0],[0 0 1 1],'r');
for cnt=1:100
set(hp,'xData',[0 cnt/100 cnt/100 0])
pause(.1)
end

Sign in to comment.

Accepted Answer

Jan
Jan on 5 Feb 2015
Drag and drop is an open problem in Matlab. You could use an ActiveX control under Windows, but you did not specify if the code must be platform-independent.
See:

  0 Comments

Sign in to comment.

More Answers (1)

Xiangrui Li
Xiangrui Li on 28 Jun 2016
For anyone who is interested, here is a nice solution with java
-Xiangrui

  0 Comments

Sign in to comment.

Sign in to answer this question.