• 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

    良辰美景补天漏,风雨雷电洗地尘
    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  • 相关阅读:
    Linux 3.2中回写机制的变革
    Linux字符设备与块设备的区别与比较
    分布式文件系统:原理、问题与方法
    为什么说B+-tree比B 树更适合实际应用中操作系统的文件索引和数据库索引?
    Linux IO barrier
    磁盘IO:缓存IO与直接IO
    【珍藏】高性能IO模型浅析
    souretree+上面提交代码和gerrit上面出现Cannot+merge的时候的解决方法
    vscode快速生成自定义HTML模板
    在jq里面设置样式的高度height、设置隐藏和显示的小功能
  • 原文地址:https://www.cnblogs.com/welhzh/p/3550522.html
Copyright © 2020-2023  润新知