Git Product home page Git Product logo

liblsl-matlab's Introduction

This is the MATLAB interface for liblsl.

Download & Install

Official Release

First try getting the latest release for your platform and Matlab version from the release page. Unfortunately, Matlab is very strict about using the exact right versions of binaries, and there is no easy way to automate Matlab releases (see #17), so it is very much a matter of luck as to whether or not we happen to have a release that will work for you.

From Source

Instead, you can download the source, the dependencies, and build yourself. This may sound intimidating but we've tried to automate some of the work for you. If you're lucky then it might be easier than you think.

  1. Clone or download a zip of this repository from https://github.com/labstreaminglayer/liblsl-Matlab
    • If you downloaded the zip, extract it somewhere convenient.
  2. Ensure you have an up-to-date build of the liblsl library binary available.
    • Option 1: Do nothing and it will download automatically when first required.
      • This might fail, or even if it succeeds in downloading the file, you might still get errors trying to load the library. Try Option 2 next.
    • Option 2: Download precompiled libraries from the liblsl release page and place it in the liblsl-Matlab/bin folder.
      • See here for more information about which library you need.
      • This doesn't always work, unfortunately. Try option 3.
    • Option 3: Build it yourself.
  3. Build the mex files.
    • In Matlab: Change Matlab's working directory to this repository's root (i.e., liblsl-Matlab) and run build_mex.
    • From the command line: matlab -nodesktop -nosplash -r 'build_mex'
    • You may need to install a compiler. See here for supported compilers. For Windows users, this usually means installing Visual Studio.

How to Use

  1. Add the liblsl-Matlab folder to your MATLAB path recursively
    • Using the MATLAB GUI, use File/Set Path...
    • Alternatively, in a script, use addpath(genpath('path/to/liblsl-Matlab'));
  2. Load the library then call a function.
    • lib = lsl_loadlib(); version = lsl_library_version(lib)
  3. See the example files in the examples/ directory for more examples of how to use this interface in a MATLAB program.

Simulink

See here.

Troubleshooting

If you get an error similar to lsl_loadlib_ undefined, then try following the "From Source" directions above.

On MacOS, you may still get an error similar to Invalid MEX-file [...] lsl_loadlib_.mexmaci64; Reason: image not found.. To fix this run the following command in a Terminal window from within the liblsl-Matlab directory: install_name_tool -add_rpath "@loader_path/" bin/lsl_loadlib_.mexmaci64

If you still can't get it to work then open an issue here and hopefully someone who has the same platform and Matlab version as you can build and upload a release for you.

liblsl-matlab's People

Contributors

cboulay avatar tstenner avatar thht avatar dmedine avatar xloem avatar kyucrane avatar vincentvjj avatar yutewang65 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.