Error using find
Too many output arguments.
Error in IP_BP (line 35)
[i,j,k,l,n] = find(C==Cmax)
源文件:
function IP_BP
clear all;
clc;
% 输入样本p和目标t--------------------------------------------------------
load IP
p = IP(:,1:2:3:4:5)';
t = IP(:,6)';
eg = 0.04722; % sum-squared error goal.残差平方和指标
sc = 8; % spread constant radial basis functions.径向基函数的分布常数
net = newrb(p,t,eg,sc);
C = sim(net,p)
N = 30;
RR = linspace(10,80,N);
Cat = linspace(30,130,N);
T = linspace(190,230,N);
P = linspace(-48,1.3,N);
Vr = linspace(45,75,N);
for i=1:N
for j=1:N
for k=1:N
for l=1:N
for n=1:N
C(i,j,k,l,n)=sim(net,[RR(j);Cat(i);T(k);P(l);Vr(n)])
end
end
end
end
end
Cmax = max(max(max(max(max(C)))))
[i,j,k,l,n] = find(C==Cmax)
RRopt = RR(j)
Catopt = Cat(i)
Topt =T(k)
Popt =P(l)
Vropt =Vr(n)
Copt = sim(net,[RRopt; Catopt;Topt;Popt;Vropt])

 Risposta accettata

0 voti

只能大致对称C为矩阵,通过find函数查找位置得到应该是行数和列数,即应该输出为两个变量,而不是五个。

Più risposte (0)

Categorie

Scopri di più su MATLAB in Centro assistenza e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!