// This GUI file is generated by guibuilder version 2.2
function Modelo_MM1infH(handles, arch) //agregar para el menu
archivo=arch;
f=figure('figure_position',[400,50],'figure_size',[988,717],'auto_resize','on','background',[22],'figure_name','Modelo M/M/1/inf/H');

delmenu(f.figure_id,gettext('File'))
delmenu(f.figure_id,gettext('?'))
delmenu(f.figure_id,gettext('Tools'))
toolbar(f.figure_id,'off')
handles.dummy = 0;
funcprot(0);
handles.txtTema=uicontrol(f,'unit','normalized','BackgroundColor',[0.1,0.5,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[24],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.0577717,0.8673913,0.8308116,0.0847826],'Relief','flat','SliderStep',[0.01,0.1],'String','Modelo M/M/1/inf/H','Style','text','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','txtTema','Callback','')
handles.btnAyuda=uicontrol(f,'unit','normalized','BackgroundColor',[0.4,0.9,0.3],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.9202201,0.8695652,0.0536451,0.0782609],'Relief','raised','SliderStep',[0.01,0.1],'String','?','Style','pushbutton','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','btnAyuda','Callback','btnAyuda_MM1infH(handles)')
handles.marco_1=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.0577717,0.5608696,0.3301238,0.2152174],'Relief','ridge','SliderStep',[0.01,0.1],'String','UnName3','Style','frame','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','marco_1','Callback','')
handles.txtLanda=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.0784044,0.7173913,0.0495186,0.0391304],'Relief','flat','SliderStep',[0.01,0.1],'String','Lamda :','Style','text','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','txtLanda','Callback','')
handles.editLamda=uicontrol(f,'unit','normalized','BackgroundColor',[1,1,1],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.127923,0.7108696,0.0949106,0.0391304],'Relief','sunken','SliderStep',[0.01,0.1],'String','0','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','editLamda','Callback','')
handles.txtMiu=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.0784044,0.6586957,0.0288858,0.0326087],'Relief','flat','SliderStep',[0.01,0.1],'String','Miu :','Style','text','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','txtMiu','Callback','')
handles.editMiu=uicontrol(f,'unit','normalized','BackgroundColor',[1,1,1],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.127923,0.6586957,0.0949106,0.0391304],'Relief','sunken','SliderStep',[0.01,0.1],'String','0','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','editMiu','Callback','')
handles.txtValorT=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.1,0.6065217,0.0165062,0.026087],'Relief','flat','SliderStep',[0.01,0.1],'String','t1 :','Style','text','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','txtValorT','Callback','')
handles.editValorT=uicontrol(f,'unit','normalized','BackgroundColor',[1,1,1],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.13,0.6,0.0412655,0.0391304],'Relief','sunken','SliderStep',[0.01,0.1],'String','0','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','editValorT','Callback','')

handles.txtValorT2=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.21,0.6065217,0.0165062,0.026087],'Relief','flat','SliderStep',[0.01,0.1],'String','t2 :','Style','text','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','txtValorT2','Callback','')
handles.editValorT2=uicontrol(f,'unit','normalized','BackgroundColor',[1,1,1],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.24,0.6,0.0412655,0.0391304],'Relief','sunken','SliderStep',[0.01,0.1],'String','0','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','editValorT2','Callback','')
/////////////////////////////////////////
handles.txtValorH=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.2517194,0.7173913,0.0371389,0.0326087],'Relief','flat','SliderStep',[0.01,0.1],'String','H :','Style','text','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','txtValorH','Callback','')
handles.editValorH=uicontrol(f,'unit','normalized','BackgroundColor',[1,1,1],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.2929849,0.7108696,0.0825309,0.0391304],'Relief','sunken','SliderStep',[0.01,0.1],'String','0','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','editValorH','Callback','')

handles.btnCalcular=uicontrol(f,'unit','normalized','BackgroundColor',[0.1,0.5,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.1609354,0.4956522,0.1320495,0.0456522],'Relief','raised','SliderStep',[0.01,0.1],'String','CALCULAR','Style','pushbutton','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','btnCalcular','Callback','btnCalcular_MM1infH(handles)')
handles.marco_2=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.0577717,0.123913,0.3259972,0.3521739],'Relief','ridge','SliderStep',[0.01,0.1],'String','','Style','frame','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','marco_2','Callback','')
handles.txtValorLambdaBarra=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.117,0.4,0.0947593,0.0456522],'Relief','flat','SliderStep',[0.01,0.1],'String','Lambda Barra ','Style','text','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','txtValorLambdaBarra','Callback','')
handles.editValorLambdaBarra=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','off','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.1196699,0.36,0.0866575,0.0391304],'Relief','sunken','SliderStep',[0.01,0.1],'String','0','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','editValorLambdaBarra','Callback','')
handles.txtValorL=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.0825309,0.2804348,0.0123796,0.0391304],'Relief','flat','SliderStep',[0.01,0.1],'String','L :','Style','text','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','txtValorL','Callback','')
handles.editValorL=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','off','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.1196699,0.2804348,0.0866575,0.0391304],'Relief','sunken','SliderStep',[0.01,0.1],'String','0','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','editValorL','Callback','')
handles.txtValorLq=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.0825309,0.2282609,0.0206327,0.0326087],'Relief','flat','SliderStep',[0.01,0.1],'String','Lq :','Style','text','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','txtValorLq','Callback','')
handles.editValorLq=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','off','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.1196699,0.2217391,0.0866575,0.0391304],'Relief','sunken','SliderStep',[0.01,0.1],'String','0','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','editValorLq','Callback','')
handles.txtValorWq=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.2393398,0.4043478,0.0247593,0.0326087],'Relief','flat','SliderStep',[0.01,0.1],'String','Wq :','Style','text','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','txtValorWq','Callback','')
handles.editValorWq=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','off','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.2723521,0.4043478,0.0866575,0.0391304],'Relief','sunken','SliderStep',[0.01,0.1],'String','0','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','editValorWq','Callback','')
handles.txtValorW_t=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.2393398,0.3456522,0.0330124,0.026087],'Relief','flat','SliderStep',[0.01,0.1],'String','W(t) :','Style','text','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','txtValorW_t','Callback','')
handles.editValorW_t=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','off','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.2806052,0.3456522,0.0784044,0.0391304],'Relief','sunken','SliderStep',[0.01,0.1],'String','0','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','editValorW_t','Callback','')
handles.txtValorWq_t=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.2393398,0.2934783,0.0412655,0.0456522],'Relief','flat','SliderStep',[0.01,0.1],'String','Wq(t) :','Style','text','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','txtValorWq_t','Callback','')
handles.editValorWq_t=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','off','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.2806052,0.2869565,0.0784044,0.0391304],'Relief','sunken','SliderStep',[0.01,0.1],'String','0','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','editValorWq_t','Callback','')
handles.txtValorW=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.0784044,0.1630435,0.0288858,0.0391304],'Relief','flat','SliderStep',[0.01,0.1],'String','W :','Style','text','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','txtValorW','Callback','')
handles.editValorW=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','off','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.1196699,0.1630435,0.0866575,0.0391304],'Relief','sunken','SliderStep',[0.01,0.1],'String','0','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','editValorW','Callback','')
handles.grafica= newaxes();handles.grafica.margins = [ 0 0 0 0];handles.grafica.axes_bounds = [0.45,0.2214984,0.4740741,0.4923127];

handles.btn_Limpiar_MM1infH_MM1=uicontrol(f,'unit','normalized','BackgroundColor',[0.1,0.5,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.1502058,0.0487013,0.1512346,0.0468182],'Relief','raised','SliderStep',[0.01,0.1],'String',' Limpiar ','Style','pushbutton','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','btn_Limpiar_MM1infH_MM1','Callback','btn_Limpiar_MM1infH(handles)')

handles.txtAzulRojo=uicontrol(f,'unit','normalized','BackgroundColor',[0.1,0.7,0.7],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.45,0.80,0.475,0.0391304],'Relief','flat','SliderStep',[0.01,0.1],'String','La Grafica W(t) en Rojo y Wq(t) en Azul','Style','text','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','txtAzul','Callback','')
handles=resume(handles);
endfunction

//////////
// Callbacks are defined as below. Please do not delete the comments as it will be used in coming version
//////////

function btnAyuda_MM1infH(handles)
    //Write your callback for  btnAyuda  here
    archivo=archivo+"Manuales/Manual_de_Usuario_Modelo_MM1infH.pdf"
    if isfile(archivo) then
        winopen(archivo);
    else
        messagebox("No se Encontro el Archivo",'ADVERTENCIA','info');
    end
endfunction

function btnCalcular_MM1infH(handles) 
          Entrada_D();
endfunction

function btn_Limpiar_MM1infH(handles)
       set(handles.editMiu, 'string', '0');
       set(handles.editLamda, 'string', '0');
       set(handles.editValorH, 'string', '0');
       set(handles.editValorT, 'string', '0');
       set(handles.editValorT2, 'string', '0');    
       
       set(handles.editValorLambdaBarra, 'String', '0');
       set(handles.editValorL, 'String', '0');
       set(handles.editValorWq, 'String', '0');
       set(handles.editValorLq, 'String', '0');
       set(handles.editValorW, 'String', '0');
       set(handles.editValorW_t, 'String', '0');
       set(handles.editValorWq_t, 'String', '0');
       
       if ~isempty(handles.grafica.children) then
                 delete(handles.grafica.children);
       end              
endfunction


function Entrada_D()
    miu=evstr(get(handles.editMiu, 'string'));
    lambda=evstr(get(handles.editLamda, 'string'));
    h=evstr(get(handles.editValorH, 'string'));
    t1=evstr(get(handles.editValorT, 'string'));
    t2=evstr(get(handles.editValorT2, 'string'));
    
    Calculos_MM1infH(lambda,miu,h);
endfunction

function Calculos_MM1infH(lambda,miu,h,t1,t2)
    
     c=ones(1,h+1);
     for i=2:h+1
       c(i)=c(i-1)*lambda/miu*(h-i+2);
     end
     vector_p=ones(1,h+1);
     
     vector_p(1)=1/sum(c);
   
    for i=2:h+1
       vector_p(i)=c(i)*vector_p(1);
    end
    
    //n es un vector formado por 1,2,3,...h
    n=linspace(1,h,h);
   
    L=sum(n.*vector_p(2:h+1));
    set(handles.editValorL, 'String',string(L));
    
    lambdaBarra=lambda*(h-L);
    set(handles.editValorLambdaBarra, 'String',string(lambdaBarra)); 
    
    W=L/lambdaBarra;
    set(handles.editValorW, 'String',string(W));
    
    wq=W-1/miu;
    set(handles.editValorWq, 'String',string(wq));
    
    Lq=lambdaBarra*wq;
    set(handles.editValorLq, 'String',string(Lq));
    
    ro_barra=lambdaBarra/miu;
    
    Graficar_MM1infH(t1,t2,miu,lambda,h,L);
endfunction

function Graficar_MM1infH(t1,t2,miu,lambda,h,L)
    
    if t2==0 then
        t2_aux=0;
        t2=h;
    else
        t2_aux=t2;
    end
        
    x=linspace(t1,t2, 100);
    n2=linspace(0,h-1,h);   
    
    vector_q=vector_p(n2+1).*(h-n2)/(h-L);
      
    variable_a_wqt=ones(1,length(x));
    variable_s_wqt=ones(1,length(x));
   
    if (h==1)
      variable_b_wqt=0;
    else      
      variable_b_wqt=vector_q(2)*ones(1,length(x));
    end
  
   for variable_n_wqt=2:h-1
      variable_a_wqt=variable_a_wqt.*(miu*x/variable_n_wqt);
      variable_s_wqt=variable_s_wqt+variable_a_wqt;
      variable_b_wqt=variable_b_wqt+vector_q(variable_n_wqt+1)*variable_s_wqt;
   end
   
   //Calcula Wq(t)
    wq_t=1-variable_b_wqt.*exp(-miu*x);
    if t1==0 then
        if t2_aux==0 then
            set(handles.editValorWq_t, 'String',string(''));
        else
            set(handles.editValorWq_t, 'String',string(wq_t(100)));
        end
    else
        set(handles.editValorWq_t, 'String',string(wq_t(100)));
    end
    variable_a_wt=ones(1,length(x));
    variable_s_wt=ones(1,length(x));
    variable_b_wt=vector_q(1)*ones(1,length(x));

   for variable_n_wt=1:h-1
      variable_a_wt=variable_a_wt.*(miu*x/variable_n_wt);
      variable_s_wt=variable_s_wt+variable_a_wt;
      variable_b_wt=variable_b_wt+vector_q(variable_n_wt+1)*variable_s_wt;
   end
   
   //Calcula W(t)
   w_t=1-variable_b_wt.*exp(-miu*x);
   if t1==0 then
      if t2_aux==0 then
        set(handles.editValorW_t, 'String',string(''));
      else
        set(handles.editValorW_t, 'String',string(w_t(1)));
      end
  else
      set(handles.editValorW_t, 'String',string(w_t(1)));
   end
   for i=1:length(w_t)
        if (w_t(i)<0)
            w_t(i)=0;
        end
    end
    
    for i=1:length(wq_t)
        if (wq_t(i)<0)
            wq_t(i)=0;
        end
    end
   
    plot(x,w_t,'r-',x,wq_t,'b');
    xgrid;xlabel('x'), ylabel('y');
endfunction

