Project-specific preferences, settings, and history

バージョン 1.1.0.0 (1.73 KB) 作成者: Petr Krysl
How to use project-specific Matlab and preferences, settings and history.
ダウンロード: 1.4K
更新 2012/11/2

ライセンスの表示

Project-specific Matlab preferences/settings/history

Solution by Petr Krysl.

Most of the time, I use or develop two, three, or more Matlab projects.
For each I like to have their separate settings: list of open files, list of visited folders, command history, shortcuts, and so on.

My solution is to fire up Matlab (under Windows) by double-clicking a batch file, which sets the MATLAB_PREFDIR environment variable before invoking Matlab. Thus, Matlab is informed where to find its settings in this particular instance.

One can run several instances of Matlab, each with its own set of preferences, settings, and history.

The project-specific settings I put into a project folder. For instance, one of my projects is in the folder SA_tools with the following structure:

SA_tools
|---profile
|---beam
|---truss
start.bat
SA_tools_init.m

The folder "profile" holds the Matlab preferences that I want to use for this project (it may be created by copying the default preferences
folder: use the Matlab command prefdir to find it; otherwise, Matlab can create this folder if it doesn't exist, and one can then tweak the
preferences in any way they like).

The batch file "start.bat" first sets the environment variable, and then invokes Matlab. The contents of this file are:

set MATLAB_PREFDIR=%cd%\profile
matlab.exe /nosplash /r SA_tools_init

Double-clicking start.bat I bring up Matlab, telling it to load the preferences from the SA_tools\profile folder, and to initialize the
project settings by running SA_tools_init.m.

引用

Petr Krysl (2024). Project-specific preferences, settings, and history (https://www.mathworks.com/matlabcentral/fileexchange/16088-project-specific-preferences-settings-and-history), MATLAB Central File Exchange. に取得済み.

MATLAB リリースの互換性
作成: R2012b
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersPackage MATLAB Functions についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
バージョン 公開済み リリース ノート
1.1.0.0

userprofile environment variable was dropped some time ago and replaced with MATLAB_PREFDIR.

1.0.0.0