The statement may begin here Matlab -END
I have this matlab code which I have been trying to debug for hour. I get the error At least one END is missing:the statement may begin here, in the line: for g ...

flag=1;
for j= 1:numel(a)
      ....
    for h = 1:numel(b)
       ...
        if ...
            if ...
               ....
            elseif ...
               ... 
                end
              end
           end
    J=[]
    for g = 1:numel(c)
        if ...
        .... 
    try, ....
      flag=flag+1
     end
   end
end


But seems correct for me... any ideas what can be missing?

Many thanks in advance
The statement may begin here Matlab -END
===

I have this matlab code which I have been trying to debug for hour. I get the error At least one END is missing:the statement may begin here, in the line: for g ...

flag=1;
for j= 1:numel(a)
      ....
    for h = 1:numel(b)
       ...
        if ...
            if ...
               ....
            elseif ...
               ... 
                end
              end
           end
    J=[]
    for g = 1:numel(c)
        if ...
        .... 
    try, ....
      flag=flag+1
     end
   end
end


But seems correct for me... any ideas what can be missing?

Many thanks in advance