MATLAB: How to count field numbers of structure

structures

Please let me know how to count field numbers of structure as below.
Structure.A = zeros(10); Structure.B = zeros(10); Structure.C = zeros(10);
there are 3 fields in structure, and I want to know number '3'.

Best Answer

length(fieldnames(Structure))