0%

给 Matlab 添加工具箱的方法

下面我将以工具箱 dfield8 和 pplane8 为例介绍如何将工具箱添加到 Matlab 的Toolbox

下载工具箱

首先到 MathWorks 下载两个工具包 dfield8Pplane

下载需要登陆账户,忘记密码就赶紧改一下吧 [Doge]

image-20230223153623818

image-20230223153708010

解压并拷贝

下载完成之后解压,然后将文件夹拷贝到 Matlab 的 toolbox 目录下。这里我的路径是 D:\Program Files\MATLAB\R2021b\toolbox

设置路径

打开Matlab,点击 File->Set Path->Add Folder,或者(中文版)直接在工具栏 环境 下选择 设置路径

添加刚才解压拷贝的文件夹。切记如果你要添加的文件夹里面还有子文件夹,一定要点击 Add with Subfolders,选择刚才文件夹,添加该文件夹的所有子文件夹。点击保存之后关闭。

更新工具箱路径缓存

File->Preferences->General 里面,选择 update Toolbox Path Cache。或者(中文版)工具栏 环境 下选择 预设

image-20230223154726554

选择 常规更新工具箱路径缓存

测试

最后我们通过 Matlab 命令行测试是否添加成功。

1
2
>> which dfield8
D:\Program Files\MATLAB\R2021b\toolbox\dfield8.m\dfield8.m

或者

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
>> help pplane8
pplane8 is an interactive tool for studying planar autonomous systems of
differential equations. When pplane8 is executed, a pplane8 Setup
window is opened. The user may enter the differential
equation and specify a display window using the interactive
controls in the Setup window. Up to 4 parameters may also be
specified. In addition the user is give a choice of the type of
field displayed and the number of field points.

When the Proceed button is pressed on the Setup window, the pplane8
Display window is opened, and a field of the type requested is
displayed for the system. When the mouse button is depressed in
the pplane8 Display window, the solution to the system with that
initial condition is calculated and plotted.

Other options are available in the menus. These are
fairly self explanatory.

This is the latest version that will run on MATLAB 9.0xxxxxxxxxx19 1D:\Program Files\MATLAB\R2021b\toolbox\dfield8.m\dfield8.m>> help pplane82   pplane8 is an interactive tool for studying planar autonomous systems of3 differential equations. When pplane8 is executed, a pplane8 Setup4 window is opened. The user may enter the differential5 equation and specify a display window using the interactive6 controls in the Setup window. Up to 4 parameters may also be 7 specified. In addition the user is give a choice of the type of 8 field displayed and the number of field points.9 10 When the Proceed button is pressed on the Setup window, the pplane811 Display window is opened, and a field of the type requested is 12 displayed for the system. When the mouse button is depressed in 13 the pplane8 Display window, the solution to the system with that14 initial condition is calculated and plotted.15 16 Other options are available in the menus. These are17 fairly self explanatory.  18 19 This is the latest version that will run on MATLAB 9.0

如果可以显示就算搞定了