zoukankan      html  css  js  c++  java
  • matlab search path

    What Is the MATLAB Search Path
    The search path, or path is a subset of all the folders in the file system. MATLAB® software uses the search path to efficiently locate files used with MathWorks® products. MATLAB can access all files in the folders on the search path.
    How MATLAB Stores the Search Path
    MATLAB saves the search path information in the pathdef.m file. The pathdef.m file is a series of full path names, one for each folder on the search path, separated by a semicolon (;).
    By default, pathdef.m is in $matlabroot/toolbox/local.

    改变上下文中的search path:
    Syntax:
    path
    path('newpath')
    path(path,'newpath')
    path('newpath',path)
    p = path
    Description
    path displays the MATLAB® search path, which is stored in pathdef.m.
    path('newpath')      changes the search path to newpath, where newpath is a string array of folders.
    path(path,'newpath')   adds the newpath folder to the end of the search path. If newpath is already on the search path, thenpath(path, 'newpath') moves newpath to the end of the search path.
    path('newpath',path)   adds the newpath folder to the top of the search path. If newpath is already on the search path, thenpath('newpath', path) moves newpath to the top of the search path. To add multiple folders in one statement, instead use addpath.
    p = path          returns the search path to string variable p.
    例子:
    path('/opt/lampp/lib', path), 即是把/opt/lampp/lib加入到search path的前面。
     

    Specifying the Java Library Path
    Java classes can dynamically load native methods using the Java method java.lang.System.loadLibrary("LibFile"). In order for the JVM software to locate the specified library file, the directory containing it must be on the Java Library Path. This path is established when MATLAB launches the JVM software at startup, and is based on the contents of the file
    $matlabroot/toolbox/local/librarypath.txt
    (where $matlabroot is the MATLAB root directory represented by the MATLAB keyword matlabroot).
    You can augment the search path for native method libraries by editing the librarypath.txt file. Follow these guidelines when editing this file:
        Specify each new directory on a line by itself.
        Specify only the directory names, not the names of the DLL files. The LoadLibrary call does this for you.
    To simplify the specification of directories in cross-platform environments, you can use any of these macros: $matlabroot, $arch, and $jre_home.

    =================================================================================
    改变matlab的 load library path: 
    第一种方法:改变library load path:
    export LD_LIBRARY_PATH=/opt/lampp/lib
    若采用这种方法,需要建立一个可执行文件 /usr/local/bin/matlab,内容为:
    #!/bin/bash
    export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/lampp/lib
    cd /opt/soft/matlab
    # 这里不能采用后台执行的方式,不然matlab 不能启动, 也即不能加 &
    ./bin/matlab
     

    第二种方法:还有另外一种方法在编程上下文定义load library path:(这个方法好像不管用)
    getenv('LD_LIBRARY_PATH')
    setenv('LD_LIBRARY_PATH', [getenv('LD_LIBRARY_PATH') ':/opt/lampp/lib']);

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    微信公众号:  共鸣圈
    欢迎讨论,邮件:  924948$qq.com       请把$改成@
    QQ群:263132197
    QQ:    924948

    良辰美景补天漏,风雨雷电洗地尘
    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  • 相关阅读:
    第10.7节 Python包和子包的定义步骤
    第10.6节 Python包的概念
    第10.5节 使用__all__定义Python模块导入白名单
    第10.4节 Python模块的弱封装机制
    第10.3节 Python导入模块能否取消导入?
    第10.2节 查看导入的Python模块
    第10.1节 Python的模块及模块导入
    第10章 Python的模块和包
    第9.13节 Python文件操作总结
    OpenCV x64 vs2010 下打开摄像头录制视频写成avi(代码为转载)
  • 原文地址:https://www.cnblogs.com/welhzh/p/3550522.html
Copyright © 2011-2022 走看看