title: How to run a loop in matlab even a struct condition satisfies and warning message?
body: <p>Lets say I have a struct with three 1x1 struct elements with 5 fields in them respectively, the struct is GroupA and 1x1 struct elements  are A,B,C and each has 5 fields in them say ID, E, F, G and h. I Need to check for each of them if h is same in any both and give a warning saying h is same in A &amp; B. For example:
  struct GroupA</p>
  
  <pre><code>A         B         C
  Id        ID        ID
  E         E         E
  F         F         F
  G         G         G
  h         h         h
  </code></pre>
  
  <p>I wrote</p>
  
  <pre><code>for B_card=1:size(GroupA,2)-1
    for C_card=(B_card+1):size(GroupA,2)
      if strcmp(GroupA(B_card).h,GroupA(C_card).h)==1
        warning('The h is same in',GroupA(B_card).ID,'&amp;',GroupA(C_card).ID);
      end
    end
  end
  </code></pre>
  
  <p>I got two problems: one the loop end (not sure whether is ending or not, can't understand) when an if condition satisfies and the warning message is only showing " The h is same in". I am quite new to Matlab so explained as good as I can, please let me know if you need some more explanation and thanks for your help.</p>