• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

labstreaminglayer/liblsl-Matlab: Matlab bindings for liblsl

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

labstreaminglayer/liblsl-Matlab

开源软件地址(OpenSource Url):

https://github.com/labstreaminglayer/liblsl-Matlab

开源编程语言(OpenSource Language):

C 72.4%

开源软件介绍(OpenSource 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.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap