MATLAB Answers

existence of structure without the use of eval

Asked by Adrian Dronca on 5 Apr 2012


I`m trying to see if a structure exists or not in the workspace (i`m checking the structure if it exists in another structure), the name of the structure can be dynamically changed so i used eval.


- The problem is that the model updates and compiles when the script hits that line and that is something I don't want.

How can i do this without making the model update ?



No products are associated with this question.

1 Answer

Answer by Oleg Komarov
on 5 Apr 2012

have you tried exist cobined with isstruct?


Adrian Dronca on 5 Apr 2012

I have the same problem and i know why, i`m trying to save some variables in a structure which has the same name as the model.

Then when eval is called it`s trying to evaluate the model.

I will change the way i save the structure if i don't find another way.

Image Analyst
on 5 Apr 2012

Or change the name of it, rather than the way you save it.

Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi test

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!