MATLAB: How to check whether a structure exists

structures

Dear all:
I have a simple question and I can't find an answer on the web…
I have a function that takes arguments in. One argument is a structure array, and inside the function I want to test whether this argument is specified and feed into the function.
I tried isexist(), but this is not for a structure. isstruct() can test whether it is a structure, but the name must exist first. isfield() can check if a structural field exist, but not the structure itself.
So my question is, how to test whether a structure exist?
Any help is appreciated.
Cheers
Ben

Best Answer

exist('structurename','var')
[EDITED, Jan Simon 25-Feb-2012 22:00 UTC]: exists -> exist