Create a GUI in Java and calling Matlab scripts from Java
Mostra commenti meno recenti
Hey all,
I currrently have a functioning Matlab script (and a few other scripts that help with it) that uses avifile, addframe and implay to create and then play back a movie of an animation I have made. The animation loops through .mat files that have
I currently have a 2D animation where I use the image function to create a 4x11 set of small boxes, each representing an individual sensor in a larger scheme of sensors implanted in the ground. In the animation, the color of each box corresponds to the scalar value of the acceleration reading for each sensor. I created the animation by using creating an aviobj using the avifile() function, then using a loop to update the color values and the object with a new figure representing the data using addframe(). I save the AVI file, then I play it back with implay() so I can have the play/pause features.
Now, I was thinking of writing some Java code and making a Java program with a GUI that in some user input for a filename/time period for the data to be used (or some user input like that) and then call the appropriate Matlab scripts from Java. How might I make this happen? I read about the matlabcontrol API and was considering that but am looking for other potential ways to handle this. A potential alternative would be to have the animation carried out from Java? Anything helps, thanks in advance
NathanF
Risposta accettata
Più risposte (1)
Yair Altman
il 7 Ago 2011
1 voto
You can use the MatlabControl Java package to call Matlab directly from Java without needing the Matlab Builder JA toolbox: http://UndocumentedMatlab.com/blog/jmi-wrapper-remote-matlabcontrol/
1 Commento
Ned Twigg
il 20 Ott 2015
matlabcontrol is fantastic, but it hasn't been updated in a couple years.
I've created a binary-compatible fork on GitHub which is actively maintained called MatConsoleCtl.
- available on Maven Central as com.diffplug.matsim:matconsolectl
- a way to connect to an existing MATLAB session by copy-pasting a string of text to the MATLAB console
- more descriptive error messages in exceptions
- compatibility with OSGi classloaders
- fixed all compiler warnings
- fixed several tricky bugs which were found by FindBugs
I'm happy to accept any GitHub Issues or Pull-Requests, and I'll be keeping it up-to-date and tested.
Categorie
Scopri di più su Text Data Preparation in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!