Why i receive this warning : Warning: Variable 'needed' exists in base workspace or data dictionary but not in the model's source workspace.
8 views (last 30 days)
Show older comments
djedoui Nassim
on 10 Dec 2018
Edited: djedoui Nassim
on 11 Dec 2018
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
0 Comments
Accepted Answer
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!