GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - diffplug/matconsolectl: Control MATLAB from Java, forked from matlabcontrol

BranchesTags
Open more actions menu

Latest commit

 

History

357 Commits
357 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
gradle/wrapper
gradle/wrapper
 
 
src
src
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
CHANGES.md
CHANGES.md
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
PULL_REQUEST_TEMPLATE.md
PULL_REQUEST_TEMPLATE.md
 
 
README.md
README.md
 
 
build.gradle
build.gradle
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
matconsolectl.png
matconsolectl.png
 
 
matconsolectl.svg
matconsolectl.svg
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

MatConsoleCtl: Control MATLAB from Java

Maven artifact Latest version Javadoc License Apache

Changelog Travis CI

MatConsoleCtl is a Java API that allows calling MATLAB from Java. You can eval, feval, as well as get and set variables. Interaction can be performed from either inside MATLAB or outside MATLAB (both by starting a new MATLAB or by connecting to an existing MATLAB).

MatlabProxyFactoryOptions.Builder builder = new MatlabProxyFactoryOptions.Builder();
// setup the factory
//    setCopyPasteCallback() connects to an existing MATLAB by copy-pasting a few lines into the command window
//    setUsePreviouslyControlledSession() starts a new MATLAB or connects to a previously started MATLAB without any user intervention

MatlabProxyFactory factory = new MatlabProxyFactory(builder.build());
// get the proxy
MatlabProxy proxy = factory.getProxy();
// do stuff over the proxy
proxy.eval("disp('hello world!)")
proxy.setVariable("a", 5.0);
Object a = proxy.getVariable("a");
double actual = ((double[]) result)[0];
assert(actual == 5.0)
// disconnect the proxy
proxy.disconnect();

Javadoc links for MatlabProxyFactoryOptions.Builder and MatlabProxy.

Contributions are welcome, see the contributing guide for development info.

Demo

MatConsoleCtl includes a demo GUI. Below is a script you can use to run the demo inside of MATLAB:

version = '4.6.0';
tempdir = 'matconsolectl_demo';

% make a directory to copy the jar into
mkdir(tempdir);
% download the jar
URL = ['https://repo1.maven.org/maven2/com/diffplug/matsim/matconsolectl/' version '/matconsolectl-' version '.jar'];
filename = [tempdir '/matconsolectl-' version '.jar'];
websave(filename,URL);
% add it to the path
javaaddpath([pwd '\' filename]);

% run it
matlabcontrol.demo.DemoMain

You can also run the demo outside of MATLAB by downloading the jar, then running java -jar matconsolectl-4.6.0.jar at a console.

Compatibility

MatConsoleCtl works on Win/Mac/Linux, MATLAB R2007b through R2016b, and it will continue to work so long as MATLAB maintains the Java MATLAB Interface.*

* On OS X 10.5, R2009a and earlier, you will need to do some hacking. matlabcontrol requires Java 6, and Apple only released 64-bit Java 6 for OS X 10.5, while MATLAB only released 32-bit MATLAB for R2009a and earlier. There are unofficial ways to run 32-bit Java 6 on OS X 10.5.

Acknowledgements

This is forked from the matlabcontrol project originally maintained on the now-defunct Google Code. The name was changed to ensure that we don't infringe the original project's license, but we did not change the package names, so this project is binary compatible with the original matlabcontrol. We are very thankful to Joshua Kaplan for creating matlabcontrol, but this fork is in no way associated with or endorsed by any authors of the original project.

We have fixed some bugs and added some features (see the changelog), and we will maintain this library into the future. We're happy to accept pull requests too!

  • Formatted by spotless, as such.
  • Bugs found by findbugs, as such.
  • OSGi metadata generated by JRuyi's [osgibnd-gradle-plugin] (https://github.com/jruyi/osgibnd-gradle-plugin), which leverages Peter Kriens' bnd.
  • Scripts in the .ci folder are inspired by Ben Limmer's work.
  • Built by gradle.
  • Tested by junit.
  • Maintained by DiffPlug.

About

Control MATLAB from Java, forked from matlabcontrol

Resources

Readme
License

Code of conduct

Code of conduct

Contributing

Contributing
Activity
Custom properties

Stars

50 stars

Watchers

5 watching

Forks

16 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.