Scripts and Functions - Kannada
- subtitles off
- captions off
- English
- Kannada
- Questions posted on Forums
- Scilab Tutorials - Kannada
-
Problem printing a graph on a GUI using scilab 6.0.2 for windows
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
01-02M 10-20S vra
Answer last updated on: May 17, 2021, 10:21 a.m.
-
exponential functions
how to find e^pi(i)
02-03M 0-10S Kanekarankita
Answer last updated on: March 4, 2021, 2:18 p.m.
-
software
my software automatically closes after 2-3 minutes. why this problem occurs even i install two times
02-03M 0-10S 2018pms5152@mnit.ac.in
Answer last updated on: Oct. 7, 2020, 8:25 a.m.
-
How to solve two equations in Scilab?
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 ?
06-07M 20-30S trulyajays
Answer last updated on: Sept. 16, 2020, 5:27 p.m.
-
Present working directory
How do I get to know my present working directory?
03-04M 20-30S hbammkanti
Answer last updated on: Sept. 16, 2020, 2:57 p.m.
-
Cannot find Load into Scilab option in Scilab 6.1.0
I am using Scilab 6.1.0 on Ubuntu 18.04, and I am unable to find the 'Load into Scilab' option.
02-03M 20-30S hbammkanti
Answer last updated on: Sept. 16, 2020, 11:17 a.m.
-
Where to find editor option?
I can't find the editor option on Scilab 6.1.0. I am using Ubuntu 18.04.
01-02M 30-40S hbammkanti
Answer last updated on: Sept. 16, 2020, 11:16 a.m.
-
file
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
02-03M 20-30S patel.yogeshwari7@gmail.com
Answer last updated on: June 3, 2020, 3:27 p.m.
-
Script related query
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.
05-06M 30-40S Shashankisingh
Answer last updated on: May 4, 2019, 4:46 p.m.
-
about execution
in scilab can we get line by line execuion like MATLAB?and can we get line by line value of any program in scilab?
03-04M 10-20S Rachana28
Answer last updated on: May 4, 2019, 4:36 p.m.
-
regarding inline function
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)")
06-07M 40-50S jeyasheelarakkini
Answer last updated on: May 4, 2019, 3:54 p.m.
-
Deff command
what is Deff command?
09-10M 40-50S rupalilokhande
Answer last updated on: May 4, 2019, 3:52 p.m.
-
inline function
deff("[v1]=sortvect1(v1)","gsort(v1)")disp(v1)the inline function working for gsort or for round functiondeff("[v2]=roundtvect2(v2)","round(v2)")
06-07M 40-50S Kkishor84k
Answer last updated on: May 4, 2019, 3:37 p.m.
-
Scipt and Function
When a function is declared with multiple return values, should the variable names in function declaration and definition should match?
07-08M 40-50S mahajanvinay83
Answer last updated on: May 4, 2019, 3:21 p.m.
-
function
how to overload function in scilab
09-10M 0-10S Ashwani0603
Answer last updated on: May 4, 2019, 3:06 p.m.
-
scripts and functions
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...)
08-09M 40-50S chitraraj05
Answer last updated on: May 4, 2019, 3:06 p.m.
-
Scripts and function
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 ???)
02-03M 30-40S chitraraj05
Answer last updated on: May 4, 2019, 2:33 p.m.
-
Scripts and Functions
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
02-03M 20-30S krishnagandhi
Answer last updated on: May 4, 2019, 2:28 p.m.
-
Data types of function parameters
Can i specifying data type of parameters in function definition?
13-14M 50-60S poornimanaik
Answer last updated on: May 4, 2019, 12:41 p.m.
-
Function with multiple return values
When a function is declared with multiple return values, should the variable names in function declaration and definition should match?
13-14M 50-60S poornimanaik
Answer last updated on: May 4, 2019, 12:40 p.m.
-
prompt in console
how to get prompt window in console as shown in video at 7.00sec
07-08M 0-10S akhtarnadaf
Answer last updated on: April 16, 2019, 3:39 p.m.
-
Scripts and Functions
while executing a file with no eco I am given the below output on consoleexec('C:\\\\\\\\Users\\\\\\\\Acer\\\\\\\\Documents\\\\\\\\kk.sce', -1)
03-04M 30-40S arpitthakur
Answer last updated on: April 16, 2019, 3:13 p.m.
-
Load into scilab
Execute button does not show load into scilab option.Scilab version 5.5.2
13-14M 10-20S akhtarnadaf
Answer last updated on: April 16, 2019, 3:07 p.m.
-
1Installing
-
2Getting Started
-
3Vector Operations
-
4Matrix Operations
-
5Conditional Branching
-
6Iteration
-
Scripts and Functions
-
8Plotting 2D graphs
-
9Xcos Introduction
-
10File handling
-
11User Defined Input and Output
-
12Integration
-
13Solving Non linear Equations
-
14Linear equations Gaussian Methods
-
15Linear equations Iterative Methods
-
16Interpolation
-
17ODE Euler methods
-
18ODE Applications
-
19Optimization Using Karmarkar Function
-
20Digital Signal Processing
-
21Control systems
-
22Discrete systems
-
23Calling User Defined Functions in XCOS
Questions posted on ST Forums:
714 visits
Outline:
Scripts and Functions *ಸೈಲ್ಯಾಬ್ ನಲ್ಲಿರುವ ಫೈಲ್ ಫಾರ್ಮ್ಯಾಟ್ ಗಳ ಪರಿಚಯ. *SCRIPT ಫೈಲ್ ಗಳು. *.sce ಮತ್ತು .sci *ಇನ್ಲೈನ್ ಫಂಕ್ಷನ್ ಗಳು.
Width: | 640 | Height: | 480 |
---|---|---|---|
Duration: | 00:13:10 | Size: | 5.8 MB |
Show video info