필터 지우기
필터 지우기

Why i receive this warning : Warning: Variable 'needed' exists in base workspace or data dictionary but not in the model's source workspace.

조회 수: 21 (최근 30일)
I want to run an optimization problem using GA, the optimization will be runned for multiple cases of study using For statement.
An objective function (myfitness) is written for the fitness functions and this function will run a Simulink model using a command line as follow
options=simset('SrcWorkspace','current''DstWorkspace','current');
sim('untitled2.slx',[],options)
The whole program is runned by a Main script in which another function 'function 2' is called to define some data and variables to be used in the fitness function (myfitness).
When the main script is runned, i got this warning and the simulation stops
' Warning: Variable 'needed' exists in base workspace or data dictionary but not in the model's source workspace. '
The variable 'needed' is obtained by calling the 'function 2' , i understand that Simulink don’t have the access to this variable , but i can see that this variable is on the workspace.
What is the solution please and what is the cause of the problem.
Best

채택된 답변

djedoui Nassim
djedoui Nassim 2018년 12월 11일
편집: djedoui Nassim 2018년 12월 11일
The solution is to use the output variables from the function 2 as global, and the problem is solved

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Signal Operations에 대해 자세히 알아보기

제품


릴리스

R2015b

Community Treasure Hunt

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

Start Hunting!

Translated by