Subscripted assignment dimension mismatch

Hello,
I tried to ran a code but when it got to the parallel loop below, it gave me the error message "Subscripted assignment dimension mismatch"
fvals=zeros(size(Data.S,1),1); %initialize vector for function values
object=Data.objfunction; %objective function handle
Samples=Data.S; %points to be evaluated in parallel
Tfeval=zeros(size(Data.S,1),1); %initialize vector for evaluation times
parfor ii = 1:size(Data.S,1) %parallel for
fevalst=tic; %record function evaluation time
fvals(ii,1)=feval(object,Samples(ii,:)); %expensive function evaluations
Tfeval(ii,1)=toc(fevalst);
end
Please what could be the problem?

답변 (1개)

Image Analyst
Image Analyst 2014년 11월 7일

0 개 추천

Your call to feval() probably returns multiple numbers instead of one.
Next time include the WHOLE error message, not just a tiny part snipped out of it. You can save time in getting to a correct solution/Answer that way.

카테고리

도움말 센터File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

질문:

2014년 11월 7일

답변:

2014년 11월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by