verify1_callback.m
上传用户:jspk663
上传日期:2013-08-19
资源大小:232k
文件大小:1k
源码类别:

matlab例程

开发平台:

Matlab

  1. function verify1_callback
  2. prompt={'Output Components:'};
  3. title='Verify Components';
  4. lines=1;
  5. def={'1...2'};
  6. answer=inputdlg(prompt,title,lines,def);
  7. v=intfromstr_dot(answer{1});
  8. l=length(v);
  9. j=0;i=1;
  10. while i<=l & v(i)==-1
  11.     i=i+1;
  12. end
  13. while i<l 
  14.     if v(i)~=-1 & v(i+1)~=-1
  15.         j=j+1;
  16.         t(j)=v(i);
  17.         i=i+1;
  18.     elseif v(i)~=-1 & v(i+1)==-1 & v(i+2)~=-1
  19.         if v(i)<=v(i+2)
  20.             temp=v(i);
  21.             while temp<=v(i+2)
  22.                 j=j+1;
  23.                 t(j)=temp;
  24.                 temp=temp+1;
  25.             end
  26.         end
  27.         i=i+3;
  28.     else 
  29.         i=i+1;
  30.     end
  31. end
  32. if i==l 
  33.     if v(i)~=-1
  34.         j=j+1;
  35.         t(j)=v(i);
  36.     end
  37. end
  38. set(gcbo,'userdata',t');%t is the output components.
  39.         
  40.     
  41.     
  42.     
  43.     
  44.     
  45.