1、下载matpower安装包,官网为matpower官方下载地址https://matpower.org/
2、将下载后的安装包解压到桌面上,并将安装包复制到matlab安装目录下的toolbox里。
3、运行matlab,在matlab的运行目录下找到刚刚复制进toolbox里的安装包文件夹,并运行里面的install_matpower.m。或输入install_matpower 回车也可。
4、出现以下情况,输入3,回车。
MATPOWER Installation Options:
1. Do NOT modify the MATLAB path
(just generate the required ADDPATH commands)
2. DO modify the MATLAB path, but only temporarily
(you will have to do it again next time you run MATLAB)
3. DO modify the MATLAB path, and SAVE the updated path
(so you will not have to do it again next time you run MATLAB)
Please enter your selection [1, 2, 3] (default = 1) :
5、出现以下情况,输入N,回车。
Use the following command to add MATPOWER to your MATLAB path:
addpath( ...
'D:\Matlab\toolbox\matpower7.1\lib', ...
'D:\Matlab\toolbox\matpower7.1\lib\t', ...
'D:\Matlab\toolbox\matpower7.1\data', ...
'D:\Matlab\toolbox\matpower7.1\most\lib', ...
'D:\Matlab\toolbox\matpower7.1\most\lib\t', ...
'D:\Matlab\toolbox\matpower7.1\mp-opt-model\lib', ...
'D:\Matlab\toolbox\matpower7.1\mp-opt-model\lib\t', ...
'D:\Matlab\toolbox\matpower7.1\mips\lib', ...
'D:\Matlab\toolbox\matpower7.1\mips\lib\t', ...
'D:\Matlab\toolbox\matpower7.1\mptest\lib', ...
'D:\Matlab\toolbox\matpower7.1\mptest\lib\t', ...
'D:\Matlab\toolbox\matpower7.1\extras\maxloadlim', ...
'D:\Matlab\toolbox\matpower7.1\extras\maxloadlim\tests', ...
'D:\Matlab\toolbox\matpower7.1\extras\maxloadlim\examples', ...
'D:\Matlab\toolbox\matpower7.1\extras\misc', ...
'D:\Matlab\toolbox\matpower7.1\extras\reduction', ...
'D:\Matlab\toolbox\matpower7.1\extras\sdp_pf', ...
'D:\Matlab\toolbox\matpower7.1\extras\se', ...
'D:\Matlab\toolbox\matpower7.1\extras\smartmarket', ...
'D:\Matlab\toolbox\matpower7.1\extras\state_estimator', ...
'D:\Matlab\toolbox\matpower7.1\extras\syngrid\lib', ...
'D:\Matlab\toolbox\matpower7.1\extras\syngrid\lib\t', ...
'-end' );
Would you like to save this command to a file? [Y or N] (default = N) :
6、将上面的代码 从 addpath 一直复制到 ‘-end’ ) , 回车运行一遍,即可完成安装。 并输入 test_matpower 回车,进行测试。测试结果等待几十秒钟,各项ok后,显示如下: