I have this error
((Subscripted assignment dimension mismatch))
appear with this function
for i=1:50
f0(i,1)=ofun(x0(i,:));
end
how can i solve this problem?

 채택된 답변

madhan ravi
madhan ravi 2018년 11월 16일
편집: madhan ravi 2018년 11월 16일

0 개 추천

f0=cell(1,50); %preallocation
for i=1:50
f0{i}=ofun(x0(i,:));
end
celldisp(f0)

댓글 수: 3

THanks alot
madhan ravi
madhan ravi 2018년 11월 16일
Anytime :)
Dear sir also appear same error with this equation in same code
((Subscripted assignment dimension mismatch))
do you have solution for this equation
ffmin(ite,run)=fmin;
the code is
% evaluating fitness
f=cell(1,50); %preallocation
for i=1:n
f{i}=ofun(x(i,:));
end
% updating pbest and fitness
for i=1:n
if f{i}<f0{i}
pbest(i,:)=x(i,:);
f0{i}=f{i};
end
end
[fmin,index]=min(f0{i});
% finding out the best particle
ffmin(ite,run)=fmin; % storing best fitness

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Mathematics and Optimization에 대해 자세히 알아보기

제품

릴리스

R2017b

질문:

2018년 11월 16일

댓글:

2018년 11월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by