필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Why do I get "Undefined function or variable 'var'."

조회 수: 1 (최근 30일)
Nour BS
Nour BS 2017년 11월 14일
마감: Stephen23 2017년 11월 15일
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.
  댓글 수: 3
Nour BS
Nour BS 2017년 11월 14일
So as I understand I need to save the result "minDist" from the function to the workspace? If so, how can I do it?

답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by