Coder Social home page Coder Social logo

matlab-pkg-install's Introduction

matlab-pkg-install

A simple package for automating adding MATLAB packages/folders to the MATLAB search path on startup.

Third-party code downloaded from the MathWorks MATLAB File Exchange can be added to MATLAB's search path automatically by using an addpath command in your startup.m file in your userpath. While simple, it can be annoying to do for each subsequent package that you download (or even create yourself). This utility automates the addition of useful packages to the MATLAB search path with a simple function and offers the option to create one-off installation scripts for packages you intend to share with others. If you would like third-party/self-written code to be instantly available from the MATLAB command line, then this might be a helpful tool for you.

You can also find this code on the MATLAB File Exchange.

Usage

Begin by "installing" this package to enable its global use with other packages:

  1. Navigate to this package's directory in MATLAB.
  2. Run the install.m script.

Other packages can now be installed by using the pkg_install function:

  1. Determine the path to your new package.
  2. In MATLAB, use pkg_install('PATH_TO_PACKAGE') to add the new package to the search path and append the same search path addition command to your startup.m file. If no startup.m file is found at userpath, one will be created for you. Be careful when editing the startup.m file in the future, as removing the addpath entries appended by this utility will render it useless.

If you have a MATLAB package that you would like to create an install script for...

  1. Navigate to your package's directory in MATLAB.
  2. Use create_install_script('PACKAGE_NAME') to create a simple, portable installation script for your code. Said script will perform the same operations as this utility's pkg_install function, but might be useful for users who are not aware/do not use it.

Other Helpful Tools

This utility is very simple. If you would like a more fully-featured tool that allows for MATLAB package management similar to pip for Python or npm for Node.js, check out Omid Sani's PackMan. PackMan takes dependency management and organization a few steps further than the code in this repository by implementing package installation from internet sources (e.g. GitHub) and integrated version control. The accompanying blog post helpfully explains what PackMan has to offer and how to use it.

matlab-pkg-install's People

Contributors

alexcochran avatar

Watchers

 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.