22/8/22

Hacer Calculadora de Matrices en Scilab

// This GUI file is generated by guibuilder version 4.2.1
//////////
dataA = grand(3,3,"uin",0,0)
dataB = grand(3,3,"uin",0,0)
dataC = grand(3,3,"uin",0,0)
f=figure('figure_position',[525,59],'figure_size',[656,582],'auto_resize','on','background',[33],'figure_name','Graphic window number %d','dockable','off','infobar_visible','off','toolbar_visible','off','menubar_visible','off','default_axes','on','visible','off');
//////////
handles.dummy = 0;
handles.Sum=uicontrol(f,'unit','normalized','BackgroundColor',[-1,-1,-1],'Enable','on','FontAngle','normal','FontName','Tahoma','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[-1,-1,-1],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.0984375,0.5979167,0.203125,0.1041667],'Relief','default','SliderStep',[0.01,0.1],'String','Suma','Style','pushbutton','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','Sum','Callback','Sum_callback(handles)')
handles.res=uicontrol(f,'unit','normalized','BackgroundColor',[-1,-1,-1],'Enable','on','FontAngle','normal','FontName','Tahoma','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[-1,-1,-1],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.4015625,0.6041667,0.196875,0.0979167],'Relief','default','SliderStep',[0.01,0.1],'String','restar','Style','pushbutton','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','res','Callback','res_callback(handles)')
handles.inv=uicontrol(f,'unit','normalized','BackgroundColor',[-1,-1,-1],'Enable','on','FontAngle','normal','FontName','Tahoma','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[-1,-1,-1],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.096875,0.4,0.2015625,0.1],'Relief','default','SliderStep',[0.01,0.1],'String','Inversa','Style','pushbutton','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','inv','Callback','inv_callback(handles)')
handles.mul=uicontrol(f,'unit','normalized','BackgroundColor',[-1,-1,-1],'Enable','on','FontAngle','normal','FontName','Tahoma','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[-1,-1,-1],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.4015625,0.4041667,0.1953125,0.0958333],'Relief','default','SliderStep',[0.01,0.1],'String','Multiplicacion','Style','pushbutton','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','mul','Callback','mul_callback(handles)')

f.visible = "on";

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

function Sum_callback(handles)
//Write your callback for  Sum  here
//Write your callback for  Sum  here

//Write your callback for  Medio_Boton  here
    n = 3
    m = 3
    mat = rand(n, m);
    row = _("row");
    labelv = row(ones(1, n))+string(1:n); //debe ser String mismo
    col = _("col");
    labelh = col(ones(1, m))+string(1:m);
    res = evstr(x_mdialog(_("Matrix to edit"), labelv, labelh, string(mat)));

    if ~isempty(res) then
       dataA=res
        disp("Matriz A",dataA)
    end

//Write your callback for  dere_botton  here
    n = 3
    m = 3
    mat = rand(n, m);
    row = _("row");
    labelv = row(ones(1, n))+string(1:n); //debe ser String mismo
    col = _("col");
    labelh = col(ones(1, m))+string(1:m);
    res = evstr(x_mdialog(_("Matrix to edit"), labelv, labelh, string(mat)));

    if ~isempty(res) then
        dataB=res
        disp("segunda",dataB)
        dataC=dataA+dataB
        disp("resultado",dataC)

    end
endfunction

function res_callback(handles)
//Write your callback for  res  here
//Write your callback for  Sum  here

//Write your callback for  Medio_Boton  here
    n = 3
    m = 3
    mat = rand(n, m);
    row = _("row");
    labelv = row(ones(1, n))+string(1:n); //debe ser String mismo
    col = _("col");
    labelh = col(ones(1, m))+string(1:m);
    res = evstr(x_mdialog(_("Matrix to edit"), labelv, labelh, string(mat)));

    if ~isempty(res) then
       dataA=res
        disp("Matriz A",dataA)
    end

//Write your callback for  dere_botton  here
    n = 3
    m = 3
    mat = rand(n, m);
    row = _("row");
    labelv = row(ones(1, n))+string(1:n); //debe ser String mismo
    col = _("col");
    labelh = col(ones(1, m))+string(1:m);
    res = evstr(x_mdialog(_("Matrix to edit"), labelv, labelh, string(mat)));

    if ~isempty(res) then
        dataB=res
        disp("Matriz B",dataB)
        dataC=dataA-dataB
        disp("resultado",dataC)

    end
endfunction

function inv_callback(handles)
//Write your callback for  inv  here
    n = 3
    m = 3
    mat = rand(n, m);
    row = _("row");
    labelv = row(ones(1, n))+string(1:n); //debe ser String mismo
    col = _("col");
    labelh = col(ones(1, m))+string(1:m);
    res = evstr(x_mdialog(_("Matrix to edit"), labelv, labelh, string(mat)));

    if ~isempty(res) then
       dataA=res
        disp("Matriz A",dataA)
        dataC=inv(dataA)
        disp("Resultado",dataC)
    end
endfunction

function mul_callback(handles)
//Write your callback for  mul  here
    n = 3
    m = 3
    mat = rand(n, m);
    row = _("row");
    labelv = row(ones(1, n))+string(1:n); //debe ser String mismo
    col = _("col");
    labelh = col(ones(1, m))+string(1:m);
    res = evstr(x_mdialog(_("Matrix to edit"), labelv, labelh, string(mat)));

    if ~isempty(res) then
       dataA=res
        disp("Matriz A",dataA)
    end

//Write your callback for  dere_botton  here
    n = 3
    m = 3
    mat = rand(n, m);
    row = _("row");
    labelv = row(ones(1, n))+string(1:n); //debe ser String mismo
    col = _("col");
    labelh = col(ones(1, m))+string(1:m);
    res = evstr(x_mdialog(_("Matrix to edit"), labelv, labelh, string(mat)));

    if ~isempty(res) then
        dataB=res
        disp("Matriz B",dataB)
        dataC=dataA*dataB
        disp("resultado",dataC)

    end
endfunction

No hay comentarios.:

Publicar un comentario