how in matlab check for existence of a structure with fields in the workspace

Viewed 7026

I have a string and want to check if in the workspace exist any variable with the same name. In the workspace I have also many structures M.N.O M.N.N M.N.M etc. I can only check if there exist a variable with the name M. How to go deeper into this structure? I tried:

exist('M.N')
YesNo = any(strcmp(who,'M.N.O'))
evalin('base','exist(''M.N.O'',''var'')')

all give me the same problem so I am stuck.

2 Answers
Related