Info
此问题已关闭。 请重新打开它进行编辑或回答。
Why do I get "Undefined function or variable 'var'."
1 次查看(过去 30 天)
显示 更早的评论
Hi, My code is a for loop which runs a function tsp_ga.m n times. this function (tsp_ga) gives a result "minDist". So my objective is to store the n obtained results in a vector. And to do it I Wrote the following code:
for kk=1:5
k
tsp_ga
ss(kk)=minDist
end
But it gave the following error: " Undefined function or variable 'minDist'.
Error in (line 4) ss(kk)=minDist_ ".
PS.: you will find attached the function tsp_ga.
Thank you in advance.
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!