matlab-java

Text 'Extent' property doesn't contain the correct size

谁说我不能喝 提交于 2019-12-30 18:47:13
问题 I want to place some text in a GUI, and I want to know the exact size the uicontrol of type 'text' needs to be! I've found several threads explaining that this can be done using the 'Extent' property of a 'text' object containing the same text, see example: function form = tempfunc(txt,font,fontsize) if nargin <3 fontsize = 10; end if nargin < 2 font = 'courier'; end f = figure('Visible','off','Units','pixels'); u = uicontrol(f,'Style','text','Units','pixels','String',txt,'FontName',font,

Calling Java from Matlab is very slow

随声附和 提交于 2019-12-12 01:28:36
问题 I'm calling a jar file from Matlab using the system function. Like this: system('java -jar myfile.jar') When I run the jar file directly through CLI it runs like a charm in less than 1min. When I call it from Matlab using the system function, however, it takes around 10min to run! Any ideas on how to solve this, or the cause of the slowness? 来源: https://stackoverflow.com/questions/30740996/calling-java-from-matlab-is-very-slow

How to execute “collapse-all-folds” in the MATLAB editor programatically?

牧云@^-^@ 提交于 2019-12-05 23:25:10
问题 I've been struggling with the problem in the subject for a bit longer than I'd like to admit. I'm attempting to programatically execute the same Action that occurs when the user either clicks on the View > Collapse All button or right-clicks within the editor window and then Code Folding > Fold All . What I tried\found so far: The String that corresponds to the Action may be found in the enum com.mathworks.mde.editor.ActionID and is: 'collapse-all-folds' . When the Action activates, the

Run particular cell section from command line in Matlab?

自作多情 提交于 2019-12-01 03:17:42
问题 I am cycling through various cells in Matlab by hand in a script (let's call it foo.m): %% %Code for cell 1 %% %Code for cell 2 From the command line of Matlab, I would like to be able to selectively run the code in cell 2. The documentation only has instructions for how to do it interactively (e.g., place the cursor in the appropriate cell, then blah blah). I would like something for the command line so I can do something like foo.runCell(1) to run the code in cell 1 above. If there is no