pilabstar
2009-03-15, 10:01
我在MATLAB7.1中添加谢菲尔德大学的GA工具箱的过程如下:
1. 把GA tool文件夹复制到toolbox下,如路径为:D:\matlab\toolbox\GA tool。
2. 在matlab命令行输入如下命令:
addpath(genpath('D:\matlab\toolbox\GA tool'));
3.为验证是否添加正确,找到GA tool下的一个M文件,如:crtbp.m文件,在命令行输入:
which crtbp.m
在MATLAB7.1中找到了该文件。但是我运行以下语句的时候,在产生新的种群的时候(即用到工具箱的时候)总是出现警告。
程序:
figure(1);
fplot('variable.*sin(10*pi*variable)+2.0',[-1,2]);%画出函数曲线
%定义遗传算法参数
NIND=40;%个体数目(Number of individual)
MAXGEN=25;%最大遗传代数(Maximum number of generations)
PRECI=20;%变量二进制位数(Precision of variable)
GGAP=0.9;%代沟(Generation gap)
trace=zeros(2,MAXGEN);%寻优结果的初始值
FieldD=[20;-1;2;1;0;1;1];%区域扫描器(Build field descriptor)
Chrom=crtrp(NIND,FieldD);%初始种群 [错误所在处]
.
.
.
然后MATLAB窗口就出现以下一堆话,明白了字面意思但是不知说的是什么。
Warning: Could not find an exact (case-sensitive) match for 'crtrp'.
D:\Program Files\MATLAB71\toolbox\ga tool\src\CRTRP.M is a case-insensitive match and will be used instead.
You can improve the performance of your code by using exact
name matches and we therefore recommend that you update your
usage accordingly. Alternatively, you can disable this warning using
warning('off','MATLAB:dispatcher:InexactMatch').
??? Error: File: CRTRP.M Line: 34 Column: 19
"nargin" previously appeared to be used as a function or command, conflicting with its use here as the name of a variable.
A possible cause of this error is that you forgot to initialize the
variable, or you have initialized it implicitly using load or eval.
请教同经验的人们,帮助一下。
1. 把GA tool文件夹复制到toolbox下,如路径为:D:\matlab\toolbox\GA tool。
2. 在matlab命令行输入如下命令:
addpath(genpath('D:\matlab\toolbox\GA tool'));
3.为验证是否添加正确,找到GA tool下的一个M文件,如:crtbp.m文件,在命令行输入:
which crtbp.m
在MATLAB7.1中找到了该文件。但是我运行以下语句的时候,在产生新的种群的时候(即用到工具箱的时候)总是出现警告。
程序:
figure(1);
fplot('variable.*sin(10*pi*variable)+2.0',[-1,2]);%画出函数曲线
%定义遗传算法参数
NIND=40;%个体数目(Number of individual)
MAXGEN=25;%最大遗传代数(Maximum number of generations)
PRECI=20;%变量二进制位数(Precision of variable)
GGAP=0.9;%代沟(Generation gap)
trace=zeros(2,MAXGEN);%寻优结果的初始值
FieldD=[20;-1;2;1;0;1;1];%区域扫描器(Build field descriptor)
Chrom=crtrp(NIND,FieldD);%初始种群 [错误所在处]
.
.
.
然后MATLAB窗口就出现以下一堆话,明白了字面意思但是不知说的是什么。
Warning: Could not find an exact (case-sensitive) match for 'crtrp'.
D:\Program Files\MATLAB71\toolbox\ga tool\src\CRTRP.M is a case-insensitive match and will be used instead.
You can improve the performance of your code by using exact
name matches and we therefore recommend that you update your
usage accordingly. Alternatively, you can disable this warning using
warning('off','MATLAB:dispatcher:InexactMatch').
??? Error: File: CRTRP.M Line: 34 Column: 19
"nargin" previously appeared to be used as a function or command, conflicting with its use here as the name of a variable.
A possible cause of this error is that you forgot to initialize the
variable, or you have initialized it implicitly using load or eval.
请教同经验的人们,帮助一下。