Questions tagged [matlab-java]

The MATLAB-Java API provides access to MATLAB's internal Java classes, allowing additional ways to customize and interact with the MATLAB environment and application GUI.

The Java interpreter can be used via MATLAB commands to create, access and use Java objects.

Books

More information:

21 questions
8
votes
2 answers

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

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…
Dev-iL
  • 23,742
  • 7
  • 57
  • 99
6
votes
1 answer

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

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…
Jens Boldsen
  • 1,255
  • 13
  • 21
5
votes
3 answers

Run particular cell section from command line in Matlab?

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…
eric
  • 7,142
  • 12
  • 72
  • 138
4
votes
2 answers

GZIP in Matlab for big files

I have a function that unpacks a byte array Z that was packaged using the zlib library (adapted from here). The packed data size is 4.11 GB, and the unpacked data will be 6.65GB. I have 32GB of memory, so this is well below the limit. I tried…
Gelliant
  • 1,835
  • 1
  • 11
  • 23
3
votes
1 answer

Using several popupmenues different rows of a uitable

To generate a ui-table I'm using GUIDE. To insert a popup menu into the ui-table I'm using the following code(for example): data = {1;2;3,'A';'B';'C'} set(handles.uitable,'ColumnFormat',{'1','2','3'},'char',data) Then i will get the same popup…
2
votes
1 answer

Why can't I execute different Matlab functions from Java concurrently?

I have two Java Servlets: DataFetcherServlet and UploaderServlet. Both servlets call 2 different Java methods which in turn call their corresponding Matlab functions through JNI, and each of which was compiled into a separate Java jar file to use as…
Trash Can
  • 6,608
  • 5
  • 24
  • 38
2
votes
1 answer

MATLAB: Reading returned array of java objects

I have an custom java object that returns an array of Thing java objects. How can I convert and iterate over the returned array as java objects in matlab? Currently, it doesn't look like the returned array is being treated as java…
Jonno_FTW
  • 8,601
  • 7
  • 58
  • 90
1
vote
1 answer

Matlab not able to import from jar in javaclasspath.txt

I add C:/example/myPackage.jar to my javaclasspath.txt. The file shows up at the end of the javaclasspath output. However, when I attempt to import com.example.*, my subsequent methodsview fails. When I javaaddpath('C:/example/myPackage.jar'), I get…
JavaA
  • 37
  • 11
1
vote
1 answer

How to use / run Matlab .m file in Eclipse?

I have create .m file or .mat file i.e Matlab file and I am using Eclipse december 2017 version JDK 10 , what all are the steps to use these already created .m files / .mat files in Eclipse to run and get the output as it is giving my running .m…
sameer_nubia
  • 721
  • 8
  • 8
1
vote
1 answer

Matlab doesn't see changes in java class when recompiled

I work with Matlab and try to launch java class from it. So I add the path of java class to the classpath.txt in Matlab. Then I create an object of the java class HelloWorld and it works perfectly: o = HelloWorld; javaMethod('main', o); However,…
Macaronnos
  • 647
  • 5
  • 14
1
vote
1 answer

MATLAB : access uigetdir's internal java methods

When using the standard dir dialog box from MATLAB uigetdir, double-clicking on a directory leads to the dialog box entering it and displaying its contents. To actually select it, you have to click on the "select directory" button. What I would like…
Parker Lewis
  • 323
  • 1
  • 9
1
vote
2 answers

how to catch java exception from MATLAB code

when I call myFunction(test) it goes correctly but throws java exception java.lang.StringIndexOutOfBoundsException: String index out of range: -1 and I would like to catch it and/or catch any java exception. I tried : try myFunction(test) catch…
lola
  • 5,649
  • 11
  • 49
  • 61
0
votes
1 answer

java spring apllication integration with matlab playground

I have an java-spring-angular application where i would like to introduce matlab plaground. I am using GNU octave(https://www.gnu.org/software/octave/index) for executing matlab code. Is there a working small example for the integration.…
user10478566
  • 37
  • 12
0
votes
0 answers

Java application progress bar color changed while running in Matlab

I am applying a JAVA application with Matlab. When I test my program in Eclipse, everything is fine, the progress bar is showing in desired color. But when I call this JAVA application(through jar file) from Matlab. The progress bar is all green, I…
DarkSoul
  • 11
  • 2
0
votes
1 answer

Can Java use MATLAB methods provided host machine only has MATLAB Runtime

I am trying to call some of the functions of MATLAB via Java. What I have on my local machine is MATLAB Runtime(64 bit) and Java 8 64 bit. Following piece of code gives an error. Code //Start MATLAB asynchronously Future eng =…
Abhishek Singh
  • 10,243
  • 22
  • 74
  • 108
1
2