MATLAB: How to use Struct Array in a function

arrayfunctionMATLABstructarrayworkspace

I have a function, which is opened by the callback openFcn in Simulink. In this function a struct Array is created with the function evalin. The Problem is that this struct Array is saved in the base Workspace and when i try to use the struct Array i get the error message 'Undefined variable "in" or class "in.Data".' How do i save that struct Array in the function Workspace to use it. Would be nice, if someone had an idea about this.

Best Answer

  • In the place you need the structure, use
    in = evalin('base', 'in') ;