Hi all, how are you?.I'm making an GUI in scilab to print and update the graph of a second order system with scilab, this GUI has a fram to input the coefficients of the system and a button to calculate and display the system, the problem is that right now the code written in the .sce file is giving me an error or running partially because it says that the function used to print the response of the system is not defined, that function is "Sis_Motor(...)" .The code is the following:// Parámetros globales de ventana global margin_x margin_y; global frame_w frame_h plot_w plot_h; //Inicialización de parámetros de ventana frame_w=300; frame_h=500; //Altura y anchura del marco. plot_w=600; plot_h=frame_h; //Altura y anchura de la impresión. margin_x=15; margin_y=15; //Margen horizontal y vertical para //elementos. defaultfont="arial"; //Fuente por defecto. axes_w=3*margin_x+frame_w+plot_w; //Anchura de los ejes. axes_h=2*margin_y+frame_h; //Altura de los ejes (100 => Altura de la //barra de herramientas). sistem_graf=scf(10); //Crea una ventana con id=10 y la hace la //ventana corriente. //Color de fondo y texto sistem_graf.background=-2; sistem_graf.figure_position=[100 100]; sistem_graf.figure_name=gettext("Comportamiento del motor"); //Cambio de dimensiones de la figura sistem_graf.axes_size=[axes_w axes_h]; //Nuevo menú h2=uimenu("parent",sistem_graf,"label",gettext("Acerca de")); //Agregando submenús al nuevo menú uimenu("parent",h2,"label",gettext("Acerca de"),"callback","Motor_Acerca_De();"); //Creación del marco mi_marco=uicontrol("parent",sistem_graf, "relief","groove", ... "style","frame", "units","pixels", ... "position",[ margin_x margin_y frame_w frame_h], ... "horizontalalignment","center", "background",[1 1 1], ... "tag","frame_control"); //Título del marco titulo_mi_marco=uicontrol("parent",sistem_graf, "style","text", ... "string","Parámetros del sistema", "units","pixels", ... "position",[30+margin_x margin_y+frame_h-10 frame_w-60 20],... "fontname",defaultfont, "fontunits","points", ... "fontsize",16, "horizontalalignment","center", ... "background",[1 1 1], "tag","title_frame_control"); //Adicionando parámetros del modelo guih1=frame_w; guih1o=200; //Lista de etiquetas ordenadas labels1=["La [H]","Ra [Ohm]","In [A]","Par [N*m]","Ke [V/krpm]","j [N/m^2]"]; //Lista ordenada de valores por defecto values1=[0.00074,0.3,8.7,0.48,3.9,0.0035]; //Posicionamiento l1=30;l2=100;l3=110; for k=1:size(labels1,2) uicontrol("parent",sistem_graf,"style","text","string",labels1(k),"position",[l1,guih1-k*20+guih1o,l2,20],"horizontalalignment","left","fontsize",14,"background",[1 1 1]); guientry(k)=uicontrol("parent",sistem_graf,"style","edit","string",string(values1(k)),"position",[l3,guih1-k*20+guih1o,180,20],"horizontalalignment","left","fontsize",14,"background",[.9 .9 .9],"tag",labels1(k)); end //Adicionando parámetros de simulación guih2=240; guih2o=80; labels2=["Tinicio [s]","Tfin [s]","Tpaso [s]"]; values2=["0","0.5","0.001"]; l1=40;l2=100;l3=110; for k=1:size(labels2,2) uicontrol("parent",sistem_graf,"style","text","string",labels2(k),"position",[l1,guih2-k*20+guih2o,l2,20],"horizontalalignment","left","fontsize",14,"background",[1 1 1]); guientry2(k)=uicontrol("parent",sistem_graf,"style","edit","string",values2(k),"position",[l3,guih2-k*20+guih2o,120,20],"horizontalalignment","left","fontsize",14,"background",[.9 .9 .9],"tag",labels2(k)); end //Adicionando un botón huibutton=uicontrol(sistem_graf,"style","pushbutton",... "position",[110 100 100 20],"String","Graficar",... "BackgroundColor",[.9 .9 .9], "fontsize",14,... "Callback","Sistema"); //Gráfico inicial Sis_Motor(values1(1),values1(2),values1(3),values1(4),... values1(5),values1(6)); //Redibujando ventana //Cálculo del sistema function [Wn, Zita, ftr, fta]=Sis_Motor(in, par, la, ra, ke, j) kt=par/in; n=kt/(j*la); b=j/10; d=[((b*ra+ke*kt)/(j*la)) ((b*la+j*ra)/(j*la)) 1]; dpoly=poly(d,'s','c'); t=[values2(1):values2(3):values2(2)]; fta=syslin('c',n,dpoly); ftr=fta/(1+fta); [Wn,Zita]=damp(ftr); graf=csim('step',t,ftr); delete(gca()); plot2(t,graf); legend('Respuesta al escalón'); //Línea vertical. set(gca(),"auto_clear","off"); graf_eje=gca(); graf_eje.axes_bounds=[1/3,0,2/3,1]; endfunction //Graficando la función function Grafi() // delete(gca()); Sis_Motor(alues1(1),values1(2),values1(3),values1(4),... values1(5),values1(6)); // plot2d(t,graf); // legend('Respuesta al escalón'); // set(gca(),"auto_clear","off"); // graf_eje=gca(); // graf_eje.axes_bounds=[1/3,0,2/3,1]; endfunction function Motor_Acerca_De() msg=msprintf(gettext("Aplicación desarrollada por el Ing. Valery Ramirez y basada en los instructivos del equipo de Openeering.")); messagebox(msg,gettext("Acerca de"),"info","modal"); endfunctionThe line with the problem is the 83 after where it says "//Gráfico inicial", the function is called with "Sis_Motor(values1(1),values1(2),values1(3),values1(4),...values1(5),values1(6));"and the function is defined some lines bellow the call.The error is that the funcion (its called variable) "Sis_Motor" is not defined but I don't know why.If anyone can help me with that I'll be very grateful.Thanks in advance for the help
how to find e^pi(i)
my software automatically closes after 2-3 minutes. why this problem occurs even i install two times
I have two equations in my hand with unknowns.2.1 + 5.6*a - 3.2*b = 53.9 -9.5*a - 7.6*b = 7How to solve these equations in Scilab and get the values of a and b ?
How do I get to know my present working directory?
I am using Scilab 6.1.0 on Ubuntu 18.04, and I am unable to find the 'Load into Scilab' option.
I can't find the editor option on Scilab 6.1.0. I am using Ubuntu 18.04.
Is sci lab editor and Sci Note are same ? In 6 .0 i didnt find the Sci lab editor and on execution of Sci Note it shows an error
HelloI am from Shree L.R.Tiwari College of Engineering,Thane would like to know that in scripts how more than 2 or more scripts can be accumulated in the same editor.
in scilab can we get line by line execuion like MATLAB?and can we get line by line value of any program in scilab?
deff("[v1]=sortvect1(v1)","gsort(v1)")disp(v1)the inline function doesnot seem to work for gsort or for round functiondeff("[v2]=roundtvect2(v2)","round(v2)")
what is Deff command?
deff("[v1]=sortvect1(v1)","gsort(v1)")disp(v1)the inline function working for gsort or for round functiondeff("[v2]=roundtvect2(v2)","round(v2)")
When a function is declared with multiple return values, should the variable names in function declaration and definition should match?
how to overload function in scilab
In same video at 8.31 a statement given about semicolon ...what is the meaning for the statement(Inside a function file,you can check for yourself the effect of putting a semicolon...)
Sir, In video tutorial at 2.38 sec shown output along with the code but im getting only output my code is not displaying in output consolein line number 2 (ie a=5;b=2;c=3; -- here without semicolon also working ..what is the use of semicolon ???)
Sir/Madam, In scripts and functions video, 2.21 sec shows the click the execute then load into the scilab. But scilab 5.5.2 shows the file with echo, files no echo, until the caret with echo, save and execute files atlast save and execute all files How i do this process? Give me direction
Can i specifying data type of parameters in function definition?
how to get prompt window in console as shown in video at 7.00sec
while executing a file with no eco I am given the below output on consoleexec('C:\\\\\\\\Users\\\\\\\\Acer\\\\\\\\Documents\\\\\\\\kk.sce', -1)
Execute button does not show load into scilab option.Scilab version 5.5.2
916 visits
Outline: સ્ક્રીપ્ટ અને ફંક્શન * સાઈલેબમાં ફાઈલ ફોરમેટનો પરિચય. * SCRIPT ફાઈલ્સ. * *sce versus .sci * ઇનલાઈન ફંક્શન.
સ્ક્રીપ્ટ અને ફંક્શન * સાઈલેબમાં ફાઈલ ફોરમેટનો પરિચય. * SCRIPT ફાઈલ્સ. * *sce versus .sci * ઇનલાઈન ફંક્શન.
Show video info
Pre-requisite