<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://script.spoken-tutorial.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://script.spoken-tutorial.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Iswariyas</id>
		<title>Script | Spoken-Tutorial - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://script.spoken-tutorial.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Iswariyas"/>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php/Special:Contributions/Iswariyas"/>
		<updated>2026-04-07T17:05:24Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.23.17</generator>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php/GUI-in-Scilab/C2/Creating-a-GUI-based-Interest-calculator/English</id>
		<title>GUI-in-Scilab/C2/Creating-a-GUI-based-Interest-calculator/English</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php/GUI-in-Scilab/C2/Creating-a-GUI-based-Interest-calculator/English"/>
				<updated>2021-09-17T10:37:40Z</updated>
		
		<summary type="html">&lt;p&gt;Iswariyas: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Title of script''': Creating a '''GUI''' based '''Interest''' calculator&lt;br /&gt;
&lt;br /&gt;
'''Author: Rashmi Patankar and Iswariya Sasikumar'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
! '''Visual Cue'''&lt;br /&gt;
! '''Narration'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Title Slide'''&lt;br /&gt;
|&lt;br /&gt;
Hello and welcome to the Spoken Tutorial on&lt;br /&gt;
&lt;br /&gt;
“'''Creating a GUI based Interest calculator”.'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Learning Objectives'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
In this tutorial, we will:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Learn about '''Radiobuttons''' and&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Calculate simple and compound interest using '''GUI.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''System Requirements'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Only Narration'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
To record this tutorial, I am using&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''Windows 10 OS'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''Scilab 6.1.0 and'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''GUI Builder Toolbox 4.2.1'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The process demonstrated in this tutorial is identical in '''Linux OS''' also.&lt;br /&gt;
&lt;br /&gt;
Annotations are added to the tutorial if there are any differences.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Pre-requisites'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
https://spoken-tutorial.org&lt;br /&gt;
|&lt;br /&gt;
To follow this tutorial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;The learner must have basic knowledge of '''Scilab''' and '''GUI Builder toolbox.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;For pre-requisite '''Scilab''' tutorials please visit this website.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Code Files'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;The files used in this tutorial are provided in the '''Code files''' link.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Please download and extract the files.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Make a copy and then use them while practising.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| What is a '''Radiobutton'''?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;A '''Radiobutton''' is a button with two states.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;They are intended to be mutually exclusive.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;As a result, at any given time only one '''button''' is in a selected state.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
Objects to calculate simple and compound interest&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
To calculate the interest, we need three '''Edit''' boxes to take user inputs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;The first '''Edit box''' for principal amount.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;The second '''Edit box''' for rate of interest.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;The third '''Edit box''' for time.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After that, we need two '''Radiobuttons''' to calculate Simple and Compound interest.&lt;br /&gt;
&lt;br /&gt;
Lastly, one '''Text''' box is required to display the answer.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Cursor on '''GUIBuilder''' Palette,&lt;br /&gt;
&lt;br /&gt;
Hover over '''GUIBuilder''' Palette and '''Graphic window number 1.'''&lt;br /&gt;
&lt;br /&gt;
Hover over three '''Edit''' boxes and one '''Text''' box&lt;br /&gt;
|&lt;br /&gt;
I have already opened the '''guiFigure.sce''' file using the '''GUIBuilder toolbox'''.&lt;br /&gt;
&lt;br /&gt;
The '''GUIBuilder Palette''' and '''Graphic window number 1''' open up.&lt;br /&gt;
&lt;br /&gt;
The graphic window shows the '''GUI''' with three '''Edit''' boxes and one '''Text''' box.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Cursor on '''GUIBuilder Palette,'''&lt;br /&gt;
&lt;br /&gt;
hover over the first '''Edit''' box.&lt;br /&gt;
| The first '''Edit''' box has the '''String''' ‘'''Enter principal amount’''' with '''Tag ‘ed_principal’.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Cursor on '''GUIBuilder''' Palette,&lt;br /&gt;
&lt;br /&gt;
hover over the second '''Edit''' box.&lt;br /&gt;
| The second '''Edit''' box has the '''String ‘Enter rate of interest’''' with '''Tag ‘ed_rate’.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Cursor on '''GUIBuilder''' Palette,&lt;br /&gt;
&lt;br /&gt;
hover over the third '''Edit''' box. &lt;br /&gt;
| The third '''Edit''' box has the '''String ‘Enter time’''' with '''Tag ‘ed_time’.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Cursor on '''GUIBuilder''' Palette,&lt;br /&gt;
&lt;br /&gt;
hover over the '''Text''' box.&lt;br /&gt;
| The '''Text''' box has the '''String ‘UnName4’''' with '''Tag ‘txt_answer’'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Only narration&lt;br /&gt;
| Now l will add two '''Radiobuttons''' for Simple interest and Compound interest.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUIBuilder Palette''',&lt;br /&gt;
&lt;br /&gt;
click '''Radiobutton.'''&lt;br /&gt;
| Go to '''GUIBuilder Palette''' and click on '''Radiobutton'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Scilab Multiple Values Request''' window,&lt;br /&gt;
&lt;br /&gt;
type '''rd_simple''' and type '''Simple interest.'''&lt;br /&gt;
&lt;br /&gt;
Click on '''OK.'''&lt;br /&gt;
|&lt;br /&gt;
Let us type '''rd_simple''' as the '''Tag''' and '''Simple interest''' as the '''String'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then click on '''OK'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 1,'''&lt;br /&gt;
&lt;br /&gt;
place '''Radiobutton''' in the middle left.&lt;br /&gt;
&lt;br /&gt;
Hover cursor over '''Simple''' '''interest''' '''Radiobutton'''.&lt;br /&gt;
|&lt;br /&gt;
Let us place this '''Radiobutton''' in the middle left of '''Graphic window number 1'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''‘Simple interest’ Radiobutton''' appears.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUIBuilder Palette''',&lt;br /&gt;
&lt;br /&gt;
click '''Radiobutton.'''&lt;br /&gt;
| Let us take another '''Radiobutton''' for the Compound interest.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Scilab Multiple Values Request''' window,&lt;br /&gt;
&lt;br /&gt;
type '''rd_compound''' and type '''Compound interest.'''&lt;br /&gt;
&lt;br /&gt;
Click on '''OK.'''&lt;br /&gt;
|&lt;br /&gt;
Now I will type '''rd_compound''' as the '''Tag''' and ‘'''Compound interest’''' as the '''String'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then click on '''OK'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 1,'''&lt;br /&gt;
&lt;br /&gt;
place '''Radiobutton''' in the middle right.&lt;br /&gt;
&lt;br /&gt;
Hover cursor over '''Radiobutton'''&lt;br /&gt;
|&lt;br /&gt;
Place this '''Radiobutton''' next to the '''Simple interest Radiobutton'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
‘'''Compound interest’ Radiobutton''' appears.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
| Now the '''GUI''' part is completed.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUIBuilder Palette''' window,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Generate&amp;amp;gt;&amp;amp;gt;Generate GUI code.'''&lt;br /&gt;
|&lt;br /&gt;
Let us save the file.&lt;br /&gt;
&lt;br /&gt;
Go to the '''GUIBuilder Palette'''.&lt;br /&gt;
&lt;br /&gt;
Click on '''Generate''' and then on the '''Generate GUI code'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Save as '''interest-calculator'''.&lt;br /&gt;
&lt;br /&gt;
Click on '''Save.'''&lt;br /&gt;
|&lt;br /&gt;
I will save this file as '''interest-calculator.'''&lt;br /&gt;
&lt;br /&gt;
Click on '''Save'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUI created window,'''&lt;br /&gt;
&lt;br /&gt;
click on '''OK.'''&lt;br /&gt;
|&lt;br /&gt;
A pop up opens with a message “'''GUI created successfully'''.”&lt;br /&gt;
&lt;br /&gt;
Click on '''OK'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''SciNotes''' window,&lt;br /&gt;
&lt;br /&gt;
highlight '''handles''' for '''principal, rate, time, simple interest, compound interest''' and '''answer'''.&lt;br /&gt;
|&lt;br /&gt;
You can see that the corresponding '''Scilab code''' has been generated.&lt;br /&gt;
&lt;br /&gt;
Notice the '''handles''' and '''properties''' of the objects we took on a '''graphic window'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Highlight '''handles.ed_principal'''.&lt;br /&gt;
| '''handles.ed_principal''' is the '''handle''' for principal amount.&lt;br /&gt;
|-&lt;br /&gt;
| Highlight '''handles.ed_rate'''.&lt;br /&gt;
| '''handles.ed_rate''' is the '''handle''' for rate.&lt;br /&gt;
|-&lt;br /&gt;
| Highlight '''handles.ed_time'''.&lt;br /&gt;
| '''handles.ed_time''' is the '''handle''' for time.&lt;br /&gt;
|-&lt;br /&gt;
| Highlight '''handles.txt_answer'''.&lt;br /&gt;
| '''handles.txt_answer''' is the '''handle''' for answer'''.'''&lt;br /&gt;
|-&lt;br /&gt;
| Highlight '''handles.rd_simple'''.&lt;br /&gt;
| '''handles.rd_simple''' is the '''handle''' for simple interest.&lt;br /&gt;
|-&lt;br /&gt;
| Highlight '''handles.rd_compound'''.&lt;br /&gt;
| '''handles.rd_compound''' is the '''handle''' for compound interest.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Hover cursor over '''rd_simple_callback'''&lt;br /&gt;
&lt;br /&gt;
function.&lt;br /&gt;
| Now let us write a function definition for '''rd_simple_callback function'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Cursor on '''SciNotes''' window,&lt;br /&gt;
&lt;br /&gt;
type within '''rd_simple_callback'''.&lt;br /&gt;
&lt;br /&gt;
'''handles.rd_simple.value = 1'''&lt;br /&gt;
&lt;br /&gt;
'''handles.rd_compound.value = 0'''&lt;br /&gt;
&lt;br /&gt;
'''Principal = strtod(handles.ed_principal.string)'''&lt;br /&gt;
&lt;br /&gt;
'''Rate = strtod(handles.ed_rate.string)'''&lt;br /&gt;
&lt;br /&gt;
'''Time = strtod(handles.ed_time.string)'''&lt;br /&gt;
&lt;br /&gt;
'''SI = (Principal * Rate * Time)/100'''&lt;br /&gt;
&lt;br /&gt;
'''handles.txt_answer.string = string(SI)'''&lt;br /&gt;
|&lt;br /&gt;
Enter the code as seen here with the same syntax.&lt;br /&gt;
&lt;br /&gt;
The same code can be found under the code files section.&lt;br /&gt;
&lt;br /&gt;
You can use it as explained earlier in this tutorial.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''handles.rd_simple.value = 1'''&lt;br /&gt;
&lt;br /&gt;
'''handles.rd_compound.value = 0'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
After clicking the '''Simple interest Radiobutton-'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;This line will select the '''Simple interest Radiobutton'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;The following line will deselect the '''Compound interest''' '''Radiobutton'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This way only one button remains selected.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''Principal = strtod(handles.ed_principal.string)'''&lt;br /&gt;
| Next line then assigns the user input for principal value to variable '''‘Principal’'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''Rate = strtod(handles.ed_rate.string)'''&lt;br /&gt;
| Its next line assigns the user input for rate of interest to variable '''‘Rate’'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''Time = strtod(handles.ed_time.string)'''&lt;br /&gt;
| The further line assigns the user input for time to the variable '''‘Time’'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''SI = (Principal * Rate * Time)/100'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
Notice the next line.&lt;br /&gt;
&lt;br /&gt;
This equation will perform the calculations.&lt;br /&gt;
&lt;br /&gt;
The final result will be stored in the variable '''‘SI''''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''handles.txt_answer.string = string(SI)'''&lt;br /&gt;
| The last line will give the value of the variable '''‘SI’''' to the '''Text''' box.&lt;br /&gt;
|-&lt;br /&gt;
| Hover cursor over '''rd_compound_callback''' function.&lt;br /&gt;
| Next I will write a function definition for '''rd_compound_callback''' function'''.'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Cursor on '''SciNotes''' window,&lt;br /&gt;
&lt;br /&gt;
type within '''rd_compound_callback'''.&lt;br /&gt;
&lt;br /&gt;
'''handles.rd_compound.value = 1'''&lt;br /&gt;
&lt;br /&gt;
'''handles.rd_simple.value = 0'''&lt;br /&gt;
&lt;br /&gt;
'''Principal = strtod(handles.ed_principal.string)'''&lt;br /&gt;
&lt;br /&gt;
'''Rate = strtod(handles.ed_rate.string)'''&lt;br /&gt;
&lt;br /&gt;
'''Time = strtod(handles.ed_time.string)'''&lt;br /&gt;
&lt;br /&gt;
'''CI = (Principal *(1+( Rate/100))^ Time) - Principal'''&lt;br /&gt;
&lt;br /&gt;
'''handles.txt_answer.string = string(CI)'''&lt;br /&gt;
|&lt;br /&gt;
Enter the code as seen here with the same syntax.&lt;br /&gt;
&lt;br /&gt;
The same code can be found under the '''Code files''' section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''handles.rd_compound.value = 1'''&lt;br /&gt;
&lt;br /&gt;
'''handles.rd_simple.value = 0'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
This action is similar to what we have seen earlier.&lt;br /&gt;
&lt;br /&gt;
After clicking the '''Compound interest''' '''Radiobutton-'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;The first line will now select the '''Compound interest''' '''Radiobutton'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;The next line will deselect the '''Simple interest Radiobutton'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''Principal = strtod(handles.ed_principal.string)'''&lt;br /&gt;
&lt;br /&gt;
'''Rate = strtod(handles.ed_rate.string)'''&lt;br /&gt;
&lt;br /&gt;
'''Time = strtod(handles.ed_time.string)'''&lt;br /&gt;
| Notice the next three lines are the same as in the '''rd_simple_callback function.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''CI = (Principal *(1+( Rate/100))^ Time) - Principal'''&lt;br /&gt;
|&lt;br /&gt;
The next line will calculate the Compound interest.&lt;br /&gt;
&lt;br /&gt;
The final result will be stored in variable '''‘CI'.'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''handles.txt_answer.string = string(CI)'''&lt;br /&gt;
| The last line will give the value of variable '''‘CI’''' to the '''Text''' box.&lt;br /&gt;
|-&lt;br /&gt;
| Press '''Ctrl+S.'''&lt;br /&gt;
| Let us save the '''Scilab code''' by pressing '''Ctrl''' and '''S''' keys together.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Scinotes''' window,&lt;br /&gt;
&lt;br /&gt;
'''Execute'''&amp;amp;gt;&amp;amp;gt;'''file''' '''with echo'''&lt;br /&gt;
|&lt;br /&gt;
Execute this by clicking '''Execute''' on the '''menubar''' and then on '''File with echo'''.&lt;br /&gt;
&lt;br /&gt;
'''Graphic window number 2''' opens.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 2,'''&lt;br /&gt;
&lt;br /&gt;
delete '''Enter the principal amount here. '''&lt;br /&gt;
&lt;br /&gt;
Type '''8000.'''&lt;br /&gt;
&lt;br /&gt;
Delete '''Enter rate of interest.'''&lt;br /&gt;
&lt;br /&gt;
Type '''7'''.&lt;br /&gt;
&lt;br /&gt;
Delete '''Enter time.'''&lt;br /&gt;
&lt;br /&gt;
Type '''3'''.&lt;br /&gt;
|&lt;br /&gt;
Now let us test the '''GUI.'''&lt;br /&gt;
&lt;br /&gt;
Delete the '''string “Enter principal amount”''' from the '''Edit''' box and type '''8000'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Delete the '''string “Enter rate of interest”''' from the '''Edit''' box and type '''7'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Delete the '''string “Enter time”''' from the '''Edit''' box and type '''3'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 1,'''&lt;br /&gt;
&lt;br /&gt;
click on '''Simple interest radiobutton'''.&lt;br /&gt;
&lt;br /&gt;
Hover cursor over '''Text''' box.&lt;br /&gt;
|&lt;br /&gt;
Then click on the '''Simple''' '''interest''' '''Radiobutton.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The '''Text''' box shows the desired answer of '''1680''' as expected.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 1,'''&lt;br /&gt;
&lt;br /&gt;
click on '''Compound interest radiobutton'''.&lt;br /&gt;
&lt;br /&gt;
Hover cursor over '''Text''' box.&lt;br /&gt;
|&lt;br /&gt;
Next click on the '''Compound''' '''interest''' '''Radiobutton.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now the '''Text''' box shows the desired answer of '''1800.344''' as expected.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Summary'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
This brings us to the end of this tutorial.  Let us summarise.&lt;br /&gt;
&lt;br /&gt;
In this tutorial, we have:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Learnt about '''Radiobuttons''' and&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Calculated simple and compound interest using '''GUI.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Assignment'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
As an assignment, please do the following.&lt;br /&gt;
&lt;br /&gt;
Create a '''GUI''' which has&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;An '''Edit''' box to take user input in meters.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Two '''Radiobuttons''' to convert it into inches and feet.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;One '''Text''' box to display the output.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''About Spoken Tutorial Project'''&lt;br /&gt;
|&lt;br /&gt;
The video at the following link summarises the '''Spoken Tutorial''' project.&lt;br /&gt;
&lt;br /&gt;
Please download and watch it.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Spoken Tutorial Workshops'''&lt;br /&gt;
|&lt;br /&gt;
We conduct workshops using '''Spoken Tutorials''' and give certificates.&lt;br /&gt;
&lt;br /&gt;
Please contact us.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Answers for THIS Spoken Tutorial'''&lt;br /&gt;
| Please post your timed queries in this forum.&lt;br /&gt;
|-&lt;br /&gt;
| Show Slide: '''FOSSEE Forum'''&lt;br /&gt;
| Please post your general and technical queries on '''Scilab''' in this forum.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Textbook Companion project'''&lt;br /&gt;
|&lt;br /&gt;
The '''FOSSEE''' team coordinates the '''TBC''' project.&lt;br /&gt;
&lt;br /&gt;
For more details, please visit this site.&lt;br /&gt;
|-&lt;br /&gt;
| Show Slide: '''Lab Migration'''&lt;br /&gt;
|&lt;br /&gt;
The '''FOSSEE''' team coordinates the '''Lab Migration''' project.&lt;br /&gt;
&lt;br /&gt;
For more details, please visit this site.&lt;br /&gt;
|-&lt;br /&gt;
| Show Slide: '''Acknowledgement'''&lt;br /&gt;
| The '''Spoken Tutorial''' project is funded by the '''Ministry of Education, Government of India'''.&lt;br /&gt;
|-&lt;br /&gt;
| Show Slide: '''Thank you'''&lt;br /&gt;
|&lt;br /&gt;
This is '''Iswariya Sasikumar,''' a '''FOSSEE''' intern 2021, IIT Bombay signing off.&lt;br /&gt;
&lt;br /&gt;
Thanks for joining.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Iswariyas</name></author>	</entry>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php/GUI-in-Scilab/C2/Building-a-GUI-for-basic-plotting/English</id>
		<title>GUI-in-Scilab/C2/Building-a-GUI-for-basic-plotting/English</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php/GUI-in-Scilab/C2/Building-a-GUI-for-basic-plotting/English"/>
				<updated>2021-09-17T08:51:54Z</updated>
		
		<summary type="html">&lt;p&gt;Iswariyas: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Title of script''': Building a '''GUI''' for basic plotting.&lt;br /&gt;
&lt;br /&gt;
'''Author: Rashmi Patankar and Iswariya Sasikumar'''&lt;br /&gt;
&lt;br /&gt;
{| class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
! '''Visual Cue'''&lt;br /&gt;
! '''Narration'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Title Slide'''&lt;br /&gt;
|&lt;br /&gt;
Hello and welcome to the Spoken Tutorial on&lt;br /&gt;
&lt;br /&gt;
“'''Building a GUI for basic plotting”.'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Learning Objectives'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
In this tutorial, we will learn:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;About '''Checkbox'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Generate graphs of the '''sine''' and '''cosine functions''' using '''GUI'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''System Requirements'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Only Narration'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
To record this tutorial, I am using&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''Windows 10 OS'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''Scilab 6.1.0 and'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''GUI Builder Toolbox 4.2.1'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The process demonstrated in this tutorial is identical in '''Linux OS''' also.&lt;br /&gt;
&lt;br /&gt;
Annotations are added to the tutorial if there are any differences.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Pre-requisites'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
https://spoken-tutorial.org&lt;br /&gt;
|&lt;br /&gt;
To follow this tutorial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;The learner must have basic knowledge of '''Scilab''' and '''GUI Builder toolbox.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;For pre-requisite '''Scilab''' tutorials please visit this website.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Code Files'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;The files used in this tutorial are provided in the '''Code files''' link.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Please download and extract the files.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Make a copy and then use them while practising.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''What is Checkbox?'''&lt;br /&gt;
|&lt;br /&gt;
A '''Checkbox''' is a button with two states.&lt;br /&gt;
&lt;br /&gt;
It is used when a user wants to make multiple independent choices.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Cursor on '''GUIBuilder Palette''' and '''Graphic window number 1'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
Let us begin with creating the '''GUI'''.&lt;br /&gt;
&lt;br /&gt;
I have opened the '''GUIBuilder toolbox'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Cursor on '''GUIBuilder Palette''',&lt;br /&gt;
&lt;br /&gt;
click '''Checkbox.'''&lt;br /&gt;
| Go to '''GUIBuilder''' '''Palette''' and click on '''Checkbox'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Scilab Multiple Values Request''' window,&lt;br /&gt;
&lt;br /&gt;
type '''chk_sine''' as '''Tag''',&lt;br /&gt;
&lt;br /&gt;
type '''sin(t)''' as '''String.'''&lt;br /&gt;
&lt;br /&gt;
Click on '''OK.'''&lt;br /&gt;
|&lt;br /&gt;
Type '''chk_sine''' as the '''Tag''' and '''sin(t)''' as the '''String'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then click on '''OK'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 1,'''&lt;br /&gt;
&lt;br /&gt;
place the '''Checkbox''' in the window's top left side.&lt;br /&gt;
&lt;br /&gt;
Hover cursor over '''Checkbox'''.&lt;br /&gt;
|&lt;br /&gt;
Place the '''Checkbox''' in the window's top left side by considering a suitable size.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A '''sin(t) Checkbox''' appears. &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUIBuilder Palette''',&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
hover over '''cos(t) Checkbox.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
In the similar way, I have taken another '''Checkbox''' for the '''cosine function'''.&lt;br /&gt;
&lt;br /&gt;
I have written '''chk_cosine''' as the '''Tag''' and '''cos(t)''' as the '''String'''.&lt;br /&gt;
&lt;br /&gt;
By considering the suitable size, I have placed it below the '''sin(t) Checkbox'''.&lt;br /&gt;
&lt;br /&gt;
Pause the tutorial and do likewise in your '''GUI''' interface.&lt;br /&gt;
|-&lt;br /&gt;
| On '''GUIBuilder Palette''',&lt;br /&gt;
| To display the response of a system, we need '''Axes'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 1,'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
hover over '''Axes'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
Hence I have taken an '''Axes''' with '''ax_response''' as '''Tag''' and '''System Response''' as '''String'''.&lt;br /&gt;
&lt;br /&gt;
Notice that I have placed it on the right side of the window.&lt;br /&gt;
&lt;br /&gt;
It appears like a box with a black border.&lt;br /&gt;
&lt;br /&gt;
Again, pause the tutorial and do likewise in your '''GUI''' interface.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
| Now the '''GUI''' part is completed. &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUIBuilder Palette''' window,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Generate&amp;amp;gt;&amp;amp;gt;Generate GUI code.'''&lt;br /&gt;
|&lt;br /&gt;
Let us generate the '''Scilab code''' file for this.&lt;br /&gt;
&lt;br /&gt;
Go to the '''GUIBuilder Palette'''.&lt;br /&gt;
&lt;br /&gt;
Click on '''Generate''' and then on the '''Generate GUI code.'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Save as '''finding_wave'''.&lt;br /&gt;
&lt;br /&gt;
Click on '''Save.'''&lt;br /&gt;
|&lt;br /&gt;
I will save this file as '''finding_wave.'''&lt;br /&gt;
&lt;br /&gt;
Click on '''Save'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUI created window,'''&lt;br /&gt;
&lt;br /&gt;
Click on '''OK.'''&lt;br /&gt;
|&lt;br /&gt;
A pop up opens with the message “'''GUI created successfully'''.”&lt;br /&gt;
&lt;br /&gt;
Click on '''OK.'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''SciNotes''' window,&lt;br /&gt;
&lt;br /&gt;
highlight '''handles''' for '''sine''', '''cosine''' and '''axes'''.&lt;br /&gt;
|&lt;br /&gt;
You can see that the corresponding '''Scilab code''' has been generated.&lt;br /&gt;
&lt;br /&gt;
Notice the '''handles''' and '''properties''' of the objects we took on a '''graphic window'''.&lt;br /&gt;
|-&lt;br /&gt;
| Highlight '''handles.chk_sine'''.&lt;br /&gt;
| '''handles.chk_sine''' is the '''handle''' for '''sine Checkbox.'''&lt;br /&gt;
|-&lt;br /&gt;
| Highlight '''handles.chk_cosine'''.&lt;br /&gt;
| '''handles.chk_cosine''' is the '''handle''' for '''cosine Checkbox.'''&lt;br /&gt;
|-&lt;br /&gt;
| Highlight '''handles.ax_response'''.&lt;br /&gt;
| '''handles.ax_response''' is the '''handle''' for '''Axes.'''&lt;br /&gt;
|-&lt;br /&gt;
| Hover cursor over '''chk_sine_callback''' function.&lt;br /&gt;
| Now let us write a function definition within the '''chk_sine_callback function'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Cursor on '''SciNotes''' window,&lt;br /&gt;
&lt;br /&gt;
type within '''chk_sine_callback'''.&lt;br /&gt;
&lt;br /&gt;
Type,&lt;br /&gt;
&lt;br /&gt;
'''t = 0:0.1:2*%pi;'''&lt;br /&gt;
&lt;br /&gt;
'''if handles.chk_sine.Value == 1'''&lt;br /&gt;
&lt;br /&gt;
'''then plot(t,sin(t))'''&lt;br /&gt;
&lt;br /&gt;
'''else'''&lt;br /&gt;
&lt;br /&gt;
'''plot(t,sin(t),'w')'''&lt;br /&gt;
&lt;br /&gt;
'''end'''&lt;br /&gt;
|&lt;br /&gt;
Enter the code as seen here with the same syntax.&lt;br /&gt;
&lt;br /&gt;
The same code can be found under the '''Code files''' section.&lt;br /&gt;
&lt;br /&gt;
You can use it as explained earlier in this tutorial.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''t = 0:0.1:2*%pi;'''&lt;br /&gt;
| The first line defines the range of '''t''' from '''0''' to '''2 pi''' with a step size of '''0.1'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''if handles.chk_sine.Value == 1'''&lt;br /&gt;
&lt;br /&gt;
'''then plot(t,sin(t))'''&lt;br /&gt;
&lt;br /&gt;
'''else'''&lt;br /&gt;
&lt;br /&gt;
'''plot(t,sin(t),'w')'''&lt;br /&gt;
&lt;br /&gt;
'''end'''&lt;br /&gt;
|&lt;br /&gt;
Further an '''if else''' statement is defined.&lt;br /&gt;
&lt;br /&gt;
The '''checkbox''' for '''sin(t)''' is checked if the value is set to 1.&lt;br /&gt;
&lt;br /&gt;
So, if it is checked then the response of the '''sine''' wave is plotted.&lt;br /&gt;
&lt;br /&gt;
If it is unchecked, then an invisible response will be plotted with white color.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Cursor on '''SciNotes''' window,&lt;br /&gt;
&lt;br /&gt;
type within '''chk_cosine_callback'''.&lt;br /&gt;
&lt;br /&gt;
Type,&lt;br /&gt;
&lt;br /&gt;
'''t = 0:0.1:2*%pi;'''&lt;br /&gt;
&lt;br /&gt;
'''if handles.chk_cosine.Value == 1'''&lt;br /&gt;
&lt;br /&gt;
'''then plot(t,cos(t))'''&lt;br /&gt;
&lt;br /&gt;
'''else'''&lt;br /&gt;
&lt;br /&gt;
'''plot(t,cos(t),'w')'''&lt;br /&gt;
&lt;br /&gt;
'''end'''&lt;br /&gt;
|&lt;br /&gt;
Next I will write a function definition for '''chk_cosine_callback function.'''&lt;br /&gt;
&lt;br /&gt;
Enter the code as seen here with the same syntax as explained earlier.&lt;br /&gt;
&lt;br /&gt;
The same code can also be found under the '''Code files''' section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''t = 0:0.1:2*%pi;'''&lt;br /&gt;
|&lt;br /&gt;
The first line is the same as seen in the '''chk_sine_callback function.'''&lt;br /&gt;
&lt;br /&gt;
It will define the range of '''‘t’'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''if handles.chk_cosine.Value == 1'''&lt;br /&gt;
&lt;br /&gt;
'''then plot(t,cos(t))'''&lt;br /&gt;
&lt;br /&gt;
'''else'''&lt;br /&gt;
&lt;br /&gt;
'''plot(t,cos(t),'w')'''&lt;br /&gt;
&lt;br /&gt;
'''end'''&lt;br /&gt;
|&lt;br /&gt;
Further an '''if else''' statement for '''cos(t) checkbox''' is defined.&lt;br /&gt;
&lt;br /&gt;
This action is similar to what we have seen previously.&lt;br /&gt;
&lt;br /&gt;
If the '''checkbox''' for '''cos(t)''' is checked, then it will plot the response of the '''cosine''' wave.&lt;br /&gt;
&lt;br /&gt;
If it is unchecked, then an invisible response will be plotted with white color.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Press '''Ctrl+S.'''&lt;br /&gt;
| Now let us save the '''Scilab code''' by pressing '''Ctrl''' and '''S''' keys together.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Scinotes''' window,&lt;br /&gt;
&lt;br /&gt;
'''Execute'''&amp;amp;gt;&amp;amp;gt;'''file''' '''with echo.'''&lt;br /&gt;
| To execute, click on '''Execute''' on the '''menu bar''' and then on '''file with echo'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 2,'''&lt;br /&gt;
&lt;br /&gt;
check the '''sin(t) checkbox.'''&lt;br /&gt;
&lt;br /&gt;
Hover cursor over the '''Axes'''.&lt;br /&gt;
|&lt;br /&gt;
Now check the '''sin(t) checkbox.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will see the time response of the '''sine function''' on the '''Axes'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 2,'''&lt;br /&gt;
&lt;br /&gt;
check the '''cos(t) checkbox.'''&lt;br /&gt;
&lt;br /&gt;
Hover cursor over the '''Axes'''.&lt;br /&gt;
|&lt;br /&gt;
Let us now check the '''cos(t)''' '''checkbox'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Axes''' shows the time response of the '''cosine function''' along with the '''sine''' '''function'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 2,'''&lt;br /&gt;
&lt;br /&gt;
uncheck the '''sin(t) checkbox'''&lt;br /&gt;
&lt;br /&gt;
check the '''sin(t) checkbox.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
Now uncheck the '''sin(t)''' '''checkbox.'''&lt;br /&gt;
&lt;br /&gt;
The response of '''sine''' function is not visible now.&lt;br /&gt;
&lt;br /&gt;
If we check the '''sin(t)''' '''checkbox''' then the '''sine function''' response is again visible.&lt;br /&gt;
&lt;br /&gt;
This way we can perform the basic plotting using '''GUI.'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
This brings us to the end of this tutorial. &lt;br /&gt;
&lt;br /&gt;
Let us summarise.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Summary'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
In this tutorial, we have learnt:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;About '''Checkbox'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Generated graphs of the '''sine''' and '''cosine functions''' using '''GUI'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Assignment'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
As an assignment, please do the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Add two '''Checkboxes''' to the current '''GUI''' to find:&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;inverse of '''sin(t)''' and&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;inverse of '''cos(t)'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Display the response of a system using an '''Axes'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide: &lt;br /&gt;
&lt;br /&gt;
'''About Spoken Tutorial Project'''&lt;br /&gt;
|&lt;br /&gt;
The video at the following link summarises the '''Spoken Tutorial''' project.&lt;br /&gt;
&lt;br /&gt;
Please download and watch it.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide: &lt;br /&gt;
&lt;br /&gt;
'''Spoken Tutorial Workshops'''&lt;br /&gt;
|&lt;br /&gt;
We conduct workshops using '''Spoken Tutorials''' and give certificates.&lt;br /&gt;
&lt;br /&gt;
Please contact us. &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Answers for THIS Spoken Tutorial''': &lt;br /&gt;
| Please post your timed queries in this forum.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''FOSSEE Forum'''&lt;br /&gt;
| Please post your general and technical queries on '''Scilab''' in this forum.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Textbook Companion project'''&lt;br /&gt;
|&lt;br /&gt;
The '''FOSSEE''' team coordinates the '''TBC''' project.&lt;br /&gt;
&lt;br /&gt;
For more details, please visit this site.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Lab Migration'''&lt;br /&gt;
|&lt;br /&gt;
The '''FOSSEE''' team coordinates the '''Lab Migration''' project.&lt;br /&gt;
&lt;br /&gt;
For more details, please visit this site.&lt;br /&gt;
|-&lt;br /&gt;
| Show Slide: '''Acknowledgements'''&lt;br /&gt;
| The '''Spoken Tutorial''' project is funded by the '''Ministry of Education, Government of India'''.&lt;br /&gt;
|-&lt;br /&gt;
| Show Slide: '''Thank you'''&lt;br /&gt;
|&lt;br /&gt;
This is '''Iswariya Sasikumar,''' a '''FOSSEE''' intern 2021, IIT Bombay signing off.&lt;br /&gt;
&lt;br /&gt;
Thanks for joining.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Iswariyas</name></author>	</entry>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php/GUI-in-Scilab/C2/Creating-a-GUI-based-exponent-calculator/English</id>
		<title>GUI-in-Scilab/C2/Creating-a-GUI-based-exponent-calculator/English</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php/GUI-in-Scilab/C2/Creating-a-GUI-based-exponent-calculator/English"/>
				<updated>2021-09-17T08:07:34Z</updated>
		
		<summary type="html">&lt;p&gt;Iswariyas: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Title of script''': Creating a '''GUI''' based exponent calculator&lt;br /&gt;
&lt;br /&gt;
'''Author: Rashmi Patankar and Iswariya Sasikumar'''&lt;br /&gt;
&lt;br /&gt;
{| class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
! '''Visual Cue'''&lt;br /&gt;
! '''Narration'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Title Slide'''&lt;br /&gt;
|&lt;br /&gt;
Hello and welcome to the Spoken Tutorial on&lt;br /&gt;
&lt;br /&gt;
“'''Creating a GUI based exponent calculator”.'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Learning Objectives'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
In this tutorial, we will learn how to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Calculate the exponent of a number using '''GUI''' and&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Use of '''strtod''' command.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''System Requirements'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Only narration'''&lt;br /&gt;
|&lt;br /&gt;
To record this tutorial, I am using&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''Windows 10 OS'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''Scilab 6.1.0 and'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''GUI Builder Toolbox 4.2.1'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The process demonstrated in this tutorial is identical in '''Linux OS''' also.&lt;br /&gt;
&lt;br /&gt;
Annotations are added to the tutorial if there are any differences.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Pre-requisites'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
https://spoken-tutorial.org&lt;br /&gt;
|&lt;br /&gt;
To follow this tutorial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;The learner must have basic knowledge of '''Scilab''' and '''Graphical User Interface.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;For pre-requisite '''Scilab''' tutorials please visit this website.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Code Files'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;The files used in this tutorial are provided in the '''Code files''' link.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Please download and extract the files.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Make a copy and then use them while practising.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUIBuilder toolbox''',&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
hover cursor over '''GUIBuilder Palette''' window and '''Graphic window number 1'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
I have already opened the '''GUIBuilder toolbox.'''&lt;br /&gt;
&lt;br /&gt;
As we can see there are two windows.&lt;br /&gt;
&lt;br /&gt;
The '''GUIBuilder Palette''' window is located on the left side.&lt;br /&gt;
&lt;br /&gt;
The '''Graphic window number 1''' is on the right side.&lt;br /&gt;
&lt;br /&gt;
Let us start by creating the '''GUI'''.&lt;br /&gt;
|-&lt;br /&gt;
| Only narration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
To calculate the exponent of a number, we need two inputs.&lt;br /&gt;
&lt;br /&gt;
The first input is a base number and the second input is an exponent.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUIBuilder Palette''',&lt;br /&gt;
&lt;br /&gt;
click '''Edit.'''&lt;br /&gt;
| For the first input, go to the '''GUIBuilder Palette''' and click on '''Edit'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Scilab Multiple Values Request''' window,&lt;br /&gt;
&lt;br /&gt;
type '''ed_base''' in '''Tag''' field,&lt;br /&gt;
&lt;br /&gt;
type '''Enter''' '''the base''' in '''String''' field'''.'''&lt;br /&gt;
&lt;br /&gt;
Click on '''OK.'''&lt;br /&gt;
|&lt;br /&gt;
A window named '''Scilab Multiple Values Request''' will open.&lt;br /&gt;
&lt;br /&gt;
Type '''ed underscore base''' as the '''Tag''' and '''Enter the base''' as the '''String'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then click on '''OK'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 1,'''&lt;br /&gt;
&lt;br /&gt;
Place the '''Edit''' box in window's top left side.&lt;br /&gt;
&lt;br /&gt;
Hover cursor over an '''Edit''' box.&lt;br /&gt;
|&lt;br /&gt;
Switch to the '''Graphic window number 1'''.&lt;br /&gt;
&lt;br /&gt;
Place the '''Edit box''' in the window's top left side, by considering a suitable size.&lt;br /&gt;
&lt;br /&gt;
An '''Edit box''' with the '''string “Enter the base”''' appears.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUIBuilder palette''',&lt;br /&gt;
&lt;br /&gt;
click on '''Edit'''.&lt;br /&gt;
| Let us take another '''Edit box''' for the second input.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Scilab Multiple Values Request''' window''','''&lt;br /&gt;
&lt;br /&gt;
type '''ed_exponent''' in '''Tag''' field,&lt;br /&gt;
&lt;br /&gt;
type '''Enter''' '''an exponent''' in '''String''' field'''.'''&lt;br /&gt;
&lt;br /&gt;
Click on '''OK.'''&lt;br /&gt;
|&lt;br /&gt;
I will type '''ed underscore exponent''' as the '''Tag''' and '''Enter''' '''an exponent''' as the '''String'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then click on '''OK'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 1,'''&lt;br /&gt;
&lt;br /&gt;
Place the '''Edit''' box in window's top right side.&lt;br /&gt;
&lt;br /&gt;
Hover cursor over an '''Edit''' box.&lt;br /&gt;
|&lt;br /&gt;
Consider a suitable size of the '''Edit''' box.&lt;br /&gt;
&lt;br /&gt;
Place it in the top right side of the '''Graphic window number 1'''.&lt;br /&gt;
&lt;br /&gt;
An '''Edit box''' with the '''string “Enter an exponent”''' appears.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUIBuilder Palette''' window,&lt;br /&gt;
&lt;br /&gt;
click on '''Text'''.&lt;br /&gt;
| To display output, go to the '''GUIBuilder Palette''' and click on '''Text'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Scilab Multiple Values Request''' window,&lt;br /&gt;
&lt;br /&gt;
type '''txt_output''' in '''Tag''' field'''.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click on '''OK.'''&lt;br /&gt;
|&lt;br /&gt;
I will type '''txt underscore output''' as the '''Tag'''.&lt;br /&gt;
&lt;br /&gt;
Keep the '''String''' field empty.&lt;br /&gt;
&lt;br /&gt;
We will not display any messages until we receive from the user.&lt;br /&gt;
&lt;br /&gt;
Then click on '''OK'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 1,'''&lt;br /&gt;
&lt;br /&gt;
place the '''Text''' box at bottom.&lt;br /&gt;
&lt;br /&gt;
Hover cursor over '''Text''' box.&lt;br /&gt;
|&lt;br /&gt;
I will place the '''Text box''' at the bottom of the '''Graphic window number 1'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A '''Text box''' with the '''string “UnName3”''' appears.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUIBuilder Palette window''',&lt;br /&gt;
&lt;br /&gt;
click on '''Pushbutton'''.&lt;br /&gt;
|&lt;br /&gt;
To perform the calculations, I will add a '''pushbutton'''.&lt;br /&gt;
&lt;br /&gt;
Go to '''GUIBuilder Palette''' and click on '''Pushbutton'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On the '''Scilab Multiple Values Request''' window,&lt;br /&gt;
&lt;br /&gt;
type '''pb_cal''' in '''Tag''' field and type '''Calculate''' in '''String''' field'''.'''&lt;br /&gt;
&lt;br /&gt;
Click on '''OK.'''&lt;br /&gt;
|&lt;br /&gt;
Further I will type '''pb underscore cal''' as the '''Tag''' and '''Calculate''' as the '''String''' for the '''pushbutton'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then click on '''OK'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 1,'''&lt;br /&gt;
&lt;br /&gt;
place the '''Pushbutton''' in the middle.&lt;br /&gt;
&lt;br /&gt;
Hover cursor over '''Pushbutton.'''&lt;br /&gt;
&lt;br /&gt;
Hover cursor over two '''Edit''' boxes and '''Text''' box.&lt;br /&gt;
|&lt;br /&gt;
Let us place the '''Pushbutton''' in the middle of the '''Graphic window number 1'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A '''pushbutton''' with the '''string “Calculate”''' appears.&lt;br /&gt;
&lt;br /&gt;
As a result, the '''pushbutton''' has two '''Edit boxes''' above it and a '''Text box''' below it.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
| Now the '''GUI''' part is completed.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUIBuilder Palette''' window,&lt;br /&gt;
&lt;br /&gt;
'''Generate&amp;amp;gt;&amp;amp;gt;Generate GUI code.'''&lt;br /&gt;
|&lt;br /&gt;
To save this file, go to the '''GUIBuilder Palette'''.&lt;br /&gt;
&lt;br /&gt;
Click on '''Generate''' and then on the '''Generate GUI code'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''uiputfile''' window,&lt;br /&gt;
&lt;br /&gt;
save as '''exponent-calculator'''.&lt;br /&gt;
&lt;br /&gt;
Click on '''Save.'''&lt;br /&gt;
|&lt;br /&gt;
I will save this file as '''exponent-calculator.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click on '''Save'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUI created window,'''&lt;br /&gt;
&lt;br /&gt;
click on '''OK.'''&lt;br /&gt;
|&lt;br /&gt;
A pop-up opens with the message “'''GUI created successfully'''.”&lt;br /&gt;
&lt;br /&gt;
Click on '''OK'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''SciNotes''' window,&lt;br /&gt;
&lt;br /&gt;
highlight '''handles''' for base, exponent output and Calculate.&lt;br /&gt;
|&lt;br /&gt;
We can see that the corresponding '''Scilab code''' has been generated.&lt;br /&gt;
&lt;br /&gt;
Notice the '''handles''' and '''properties''' of the objects we took on a '''graphic window'''.&lt;br /&gt;
|-&lt;br /&gt;
| Highlight '''handles.ed_base'''.&lt;br /&gt;
| '''handles dot ed underscore base''' is the '''handle''' for base.&lt;br /&gt;
|-&lt;br /&gt;
| Highlight '''handles.ed_exponent'''.&lt;br /&gt;
| '''handles dot ed underscore exponent''' is the '''handle''' for exponent.&lt;br /&gt;
|-&lt;br /&gt;
| Highlight '''handles.txt_output.'''.&lt;br /&gt;
| '''handles dot txt underscore output''' is the '''handle''' for output.&lt;br /&gt;
|-&lt;br /&gt;
| Highlight '''handles.pb_cal.'''&lt;br /&gt;
| '''handles dot pb underscore cal''' is the '''handle''' for '''Pushbutton.'''&lt;br /&gt;
|-&lt;br /&gt;
| Hover cursor over '''pb_cal_callback''' function.&lt;br /&gt;
| Now let us write a function definition for '''pb_cal_callback function'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Cursor on '''SciNotes''' window,&lt;br /&gt;
&lt;br /&gt;
type within '''pb_cal_callback'''.&lt;br /&gt;
&lt;br /&gt;
Type,&lt;br /&gt;
&lt;br /&gt;
'''base = strtod(handles.ed_base.string)'''&lt;br /&gt;
&lt;br /&gt;
'''exponent = strtod(handles.ed_exponent.string)'''&lt;br /&gt;
&lt;br /&gt;
'''out = base^exponent'''&lt;br /&gt;
&lt;br /&gt;
'''handles.txt_output.string = string(out)'''&lt;br /&gt;
|&lt;br /&gt;
Enter the code as seen here with the same syntax.&lt;br /&gt;
&lt;br /&gt;
The same code can be found under the '''Code files''' section.&lt;br /&gt;
&lt;br /&gt;
You can use it as explained earlier in this tutorial.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''base = strtod(handles.ed_base.string)'''&lt;br /&gt;
| The first line assigns the user input for a base value to the variable ‘base’.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''exponent = strtod(handles.ed_exponent.string)'''&lt;br /&gt;
| The second line assigns the user input for an exponent to the variable ‘exponent’.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''SciNotes''' window,&lt;br /&gt;
&lt;br /&gt;
within '''pb_cal_callback.'''&lt;br /&gt;
&lt;br /&gt;
highlight '''strtod''' command.&lt;br /&gt;
|&lt;br /&gt;
It is not possible to do calculations when the value is in '''string''' format.&lt;br /&gt;
&lt;br /&gt;
Hence I have put the '''handles''' inside the '''strtod''' command.&lt;br /&gt;
&lt;br /&gt;
This command will convert the value from the '''string''' format to a decimal format.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''out = base^exponent'''&lt;br /&gt;
|&lt;br /&gt;
Notice the next line.&lt;br /&gt;
&lt;br /&gt;
This equation will perform the calculations.&lt;br /&gt;
&lt;br /&gt;
The final result will be stored in the variable ‘out’.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''handles.txt_output.string = string(out)'''&lt;br /&gt;
| The last line will give the value of a variable ‘out’ to the '''Text box'''.&lt;br /&gt;
|-&lt;br /&gt;
| Press '''Ctrl+S.'''&lt;br /&gt;
| Let us save all our work by pressing '''Control''' and '''S''' keys together.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Scinotes''' window,&lt;br /&gt;
&lt;br /&gt;
'''Execute'''&amp;amp;gt;&amp;amp;gt;'''file''' '''with echo'''&lt;br /&gt;
|&lt;br /&gt;
Execute this by clicking '''Execute''' on the '''menubar''' and then on '''File with echo'''.&lt;br /&gt;
&lt;br /&gt;
The '''Graphic window number 2''' opens.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 2,'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
delete '''Enter the base. '''&lt;br /&gt;
&lt;br /&gt;
Type '''4.'''&lt;br /&gt;
&lt;br /&gt;
Delete '''Enter an exponent.'''&lt;br /&gt;
&lt;br /&gt;
Type '''2'''.&lt;br /&gt;
|&lt;br /&gt;
Now let us test the '''GUI.'''&lt;br /&gt;
&lt;br /&gt;
I will calculate '''4''' to the '''power 2'''.&lt;br /&gt;
&lt;br /&gt;
Delete the '''string “Enter the base”''' from the '''Edit box''' and type '''4'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Delete the '''string “Enter an exponent”''' from the '''Edit box''' and type '''2'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 2,'''&lt;br /&gt;
&lt;br /&gt;
click on '''Calculate Pushbutton'''.&lt;br /&gt;
&lt;br /&gt;
Hover cursor over '''Text''' box.&lt;br /&gt;
|&lt;br /&gt;
Then click on the '''Calculate Pushbutton.'''&lt;br /&gt;
&lt;br /&gt;
The '''Text box''' shows the desired answer of '''16''' as we expected.&lt;br /&gt;
&lt;br /&gt;
This way we can perform numeric calculations using '''GUI''' in '''Scilab'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Summary'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
This brings us to the end of this tutorial. Let us summarise.&lt;br /&gt;
&lt;br /&gt;
In this tutorial, we have:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Calculated the exponent of a number using '''GUI''' and&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Used '''strtod''' command.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Assignment'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
As an assignment activity, please do the following.&lt;br /&gt;
&lt;br /&gt;
Create a '''GUI''' which has&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Two '''Edit boxes''' to take two numbers from the user.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Four '''pushbuttons''' to perform addition, subtraction, multiplication and division.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;One '''Text box''' to display the answer of these operations.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''About Spoken Tutorial Project'''&lt;br /&gt;
|&lt;br /&gt;
The video at the following link summarises the '''Spoken Tutorial''' project.&lt;br /&gt;
&lt;br /&gt;
Please download and watch it.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Spoken Tutorial Workshops'''&lt;br /&gt;
|&lt;br /&gt;
We conduct workshops using '''Spoken Tutorials''' and give certificates.&lt;br /&gt;
&lt;br /&gt;
Please contact us.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Answers for THIS Spoken Tutorial'''&lt;br /&gt;
| Please post your timed queries in this forum.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''FOSSEE Forum'''&lt;br /&gt;
| Please post your general and technical queries on '''Scilab''' in this forum.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Textbook Companion project'''&lt;br /&gt;
|&lt;br /&gt;
The '''FOSSEE''' team coordinates the '''TBC''' project.&lt;br /&gt;
&lt;br /&gt;
For more details, please visit these sites.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Lab Migration'''&lt;br /&gt;
|&lt;br /&gt;
The '''FOSSEE''' team coordinates the '''Lab Migration''' project.&lt;br /&gt;
&lt;br /&gt;
For more details, please visit this site.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Acknowledgement'''&lt;br /&gt;
| The '''Spoken Tutorial''' project is funded by the '''Ministry of Education, Government of India'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Thank you'''&lt;br /&gt;
|&lt;br /&gt;
This is '''Iswariya Sasikumar''', a '''FOSSEE''' intern 2021,IIT Bombay signing off.&lt;br /&gt;
&lt;br /&gt;
Thanks for joining.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Iswariyas</name></author>	</entry>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php/GUI-in-Scilab/C2/Creating-a-GUI-based-exponent-calculator/English</id>
		<title>GUI-in-Scilab/C2/Creating-a-GUI-based-exponent-calculator/English</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php/GUI-in-Scilab/C2/Creating-a-GUI-based-exponent-calculator/English"/>
				<updated>2021-09-15T11:22:55Z</updated>
		
		<summary type="html">&lt;p&gt;Iswariyas: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Title of script''': Creating a '''GUI''' based exponent calculator&lt;br /&gt;
&lt;br /&gt;
'''Author: Rashmi Patankar and Iswariya Sasikumar'''&lt;br /&gt;
&lt;br /&gt;
{| class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
! '''Visual Cue'''&lt;br /&gt;
! '''Narration'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Title Slide'''&lt;br /&gt;
|&lt;br /&gt;
Hello and welcome to the Spoken Tutorial on&lt;br /&gt;
&lt;br /&gt;
“'''Creating a GUI based exponent calculator”.'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Learning Objectives'''&lt;br /&gt;
|&lt;br /&gt;
In this tutorial, we will learn how to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Calculate the exponent of a number using '''GUI''' and&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Use of '''strtod''' command.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''System Requirements'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Only narration'''&lt;br /&gt;
|&lt;br /&gt;
To record this tutorial, I am using&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''Windows 10 OS'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''Scilab 6.1.0 and'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''GUI Builder Toolbox 4.2.1'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The process demonstrated in this tutorial is identical in '''Linux OS''' also.&lt;br /&gt;
&lt;br /&gt;
Annotations are added to the tutorial if there are any differences.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Pre-requisites'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
https://spoken-tutorial.org&lt;br /&gt;
|&lt;br /&gt;
To follow this tutorial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;The learner must have basic knowledge of '''Scilab''' and '''Graphical User Interface.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;For pre-requisite '''Scilab''' tutorials please visit this website.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Code Files'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;The files used in this tutorial are provided in the '''Code files''' link.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Please download and extract the files.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Make a copy and then use them while practising.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUIBuilder toolbox''',&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
hover cursor over '''GUIBuilder Palette''' window and '''Graphic window number 1'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
I have already opened the '''GUIBuilder toolbox.'''&lt;br /&gt;
&lt;br /&gt;
As we can see there are two windows.&lt;br /&gt;
&lt;br /&gt;
The '''GUIBuilder Palette''' window is located on the left side.&lt;br /&gt;
&lt;br /&gt;
The '''Graphic window number 1''' is on the right side.&lt;br /&gt;
&lt;br /&gt;
Let us start by creating the '''GUI'''.&lt;br /&gt;
|-&lt;br /&gt;
| Only narration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
To calculate the exponent of a number, we need two inputs.&lt;br /&gt;
&lt;br /&gt;
The first input is a base number and the second input is an exponent.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUIBuilder Palette''',&lt;br /&gt;
&lt;br /&gt;
click '''Edit.'''&lt;br /&gt;
| For the first input, go to the '''GUIBuilder Palette''' and click on '''Edit'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Scilab Multiple Values Request''' window,&lt;br /&gt;
&lt;br /&gt;
type '''ed_base''' in '''Tag''' field,&lt;br /&gt;
&lt;br /&gt;
type '''Enter''' '''the base''' in '''String''' field'''.'''&lt;br /&gt;
&lt;br /&gt;
Click on '''OK.'''&lt;br /&gt;
|&lt;br /&gt;
A window named '''Scilab Multiple Values Request''' will open.&lt;br /&gt;
&lt;br /&gt;
Type '''ed underscore base''' as the '''Tag''' and '''Enter the base''' as the '''String'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then click on '''OK'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 1,'''&lt;br /&gt;
&lt;br /&gt;
Place the '''Edit''' box in window's top left side.&lt;br /&gt;
&lt;br /&gt;
Hover cursor over an '''Edit''' box.&lt;br /&gt;
|&lt;br /&gt;
Switch to the '''Graphic window number 1'''.&lt;br /&gt;
&lt;br /&gt;
Place the '''Edit box''' in the window's top left side, by considering a suitable size.&lt;br /&gt;
&lt;br /&gt;
An '''Edit box''' with the '''string “Enter the base”''' appears.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUIBuilder palette''',&lt;br /&gt;
&lt;br /&gt;
click on '''Edit'''.&lt;br /&gt;
| Let us take another '''Edit box''' for the second input.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Scilab Multiple Values Request''' window''','''&lt;br /&gt;
&lt;br /&gt;
type '''ed_exponent''' in '''Tag''' field,&lt;br /&gt;
&lt;br /&gt;
type '''Enter''' '''an exponent''' in '''String''' field'''.'''&lt;br /&gt;
&lt;br /&gt;
Click on '''OK.'''&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I will type '''ed underscore exponent''' as the '''Tag''' and '''Enter''' '''an exponent''' as the '''String'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then click on '''OK'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 1,'''&lt;br /&gt;
&lt;br /&gt;
Place the '''Edit''' box in window's top right side.&lt;br /&gt;
&lt;br /&gt;
Hover cursor over an '''Edit''' box.&lt;br /&gt;
|&lt;br /&gt;
Consider a suitable size of the '''Edit''' box.&lt;br /&gt;
&lt;br /&gt;
Place it in the top right side of the '''Graphic window number 1'''.&lt;br /&gt;
&lt;br /&gt;
An '''Edit box''' with the '''string “Enter an exponent”''' appears.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUIBuilder Palette''' window,&lt;br /&gt;
&lt;br /&gt;
click on '''Text'''.&lt;br /&gt;
| To display output, go to the '''GUIBuilder Palette''' and click on '''Text'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Scilab Multiple Values Request''' window,&lt;br /&gt;
&lt;br /&gt;
type '''txt_output''' in '''Tag''' field'''.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click on '''OK.'''&lt;br /&gt;
|&lt;br /&gt;
I will type '''txt underscore output''' as the '''Tag'''.&lt;br /&gt;
&lt;br /&gt;
Keep the '''String''' field empty.&lt;br /&gt;
&lt;br /&gt;
We will not display any messages until we receive from the user.&lt;br /&gt;
&lt;br /&gt;
Then click on '''OK'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 1,'''&lt;br /&gt;
&lt;br /&gt;
place the '''Text''' box at bottom.&lt;br /&gt;
&lt;br /&gt;
Hover cursor over '''Text''' box.&lt;br /&gt;
|&lt;br /&gt;
I will place the '''Text box''' at the bottom of the '''Graphic window number 1'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A '''Text box''' with the '''string “UnName3”''' appears.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUIBuilder Palette window''',&lt;br /&gt;
&lt;br /&gt;
click on '''Pushbutton'''.&lt;br /&gt;
|&lt;br /&gt;
To perform the calculations, I will add a '''pushbutton'''.&lt;br /&gt;
&lt;br /&gt;
Go to '''GUIBuilder Palette''' and click on '''Pushbutton'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On the '''Scilab Multiple Values Request''' window,&lt;br /&gt;
&lt;br /&gt;
type '''pb_cal''' in '''Tag''' field and type '''Calculate''' in '''String''' field'''.'''&lt;br /&gt;
&lt;br /&gt;
Click on '''OK.'''&lt;br /&gt;
|&lt;br /&gt;
Further I will type '''pb underscore cal''' as the '''Tag''' and '''Calculate''' as the '''String''' for the '''pushbutton'''.&lt;br /&gt;
&lt;br /&gt;
Then click on '''OK'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 1,'''&lt;br /&gt;
&lt;br /&gt;
place the '''Pushbutton''' in the middle.&lt;br /&gt;
&lt;br /&gt;
Hover cursor over '''Pushbutton.'''&lt;br /&gt;
&lt;br /&gt;
Hover cursor over two '''Edit''' boxes and '''Text''' box.&lt;br /&gt;
|&lt;br /&gt;
Let us place the '''Pushbutton''' in the middle of the '''Graphic window number 1'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A '''pushbutton''' with the '''string “Calculate”''' appears.&lt;br /&gt;
&lt;br /&gt;
As a result, the '''pushbutton''' has two '''Edit boxes''' above it and a '''Text box''' below it.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
| Now the '''GUI''' part is completed.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUIBuilder Palette''' window,&lt;br /&gt;
&lt;br /&gt;
'''Generate&amp;amp;gt;&amp;amp;gt;Generate GUI code.'''&lt;br /&gt;
|&lt;br /&gt;
To save this file, go to the '''GUIBuilder Palette'''.&lt;br /&gt;
&lt;br /&gt;
Click on '''Generate''' and then on the '''Generate GUI code'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''uiputfile''' window,&lt;br /&gt;
&lt;br /&gt;
save as '''exponent-calculator'''.&lt;br /&gt;
&lt;br /&gt;
Click on '''Save.'''&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I will save this file as '''exponent-calculator.'''&lt;br /&gt;
&lt;br /&gt;
Click on '''Save'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUI created window,'''&lt;br /&gt;
&lt;br /&gt;
click on '''OK.'''&lt;br /&gt;
|&lt;br /&gt;
A pop-up opens with the message “'''GUI created successfully'''.”&lt;br /&gt;
&lt;br /&gt;
Click on '''OK'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''SciNotes''' window,&lt;br /&gt;
&lt;br /&gt;
highlight '''handles''' for base, exponent output and Calculate.&lt;br /&gt;
|&lt;br /&gt;
We can see that the corresponding '''Scilab code''' has been generated.&lt;br /&gt;
&lt;br /&gt;
Notice the '''handles''' and '''properties''' of the objects we took on a '''graphic window'''.&lt;br /&gt;
|-&lt;br /&gt;
| Highlight '''handles.ed_base'''.&lt;br /&gt;
| '''handles dot ed underscore base''' is the '''handle''' for base.&lt;br /&gt;
|-&lt;br /&gt;
| Highlight '''handles.ed_exponent'''.&lt;br /&gt;
| '''handles dot ed underscore exponent''' is the '''handle''' for exponent.&lt;br /&gt;
|-&lt;br /&gt;
| Highlight '''handles.txt_output.'''.&lt;br /&gt;
| '''handles dot txt underscore output''' is the '''handle''' for output.&lt;br /&gt;
|-&lt;br /&gt;
| Highlight '''handles.pb_cal.'''&lt;br /&gt;
| '''handles dot pb underscore cal''' is the '''handle''' for '''Pushbutton.'''&lt;br /&gt;
|-&lt;br /&gt;
| Hover cursor over '''pb_cal_callback''' function.&lt;br /&gt;
| Now let us write a '''function definition''' for '''pb_cal_callback function'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Cursor on '''SciNotes''' window,&lt;br /&gt;
&lt;br /&gt;
type within '''pb_cal_callback'''.&lt;br /&gt;
&lt;br /&gt;
Type,&lt;br /&gt;
&lt;br /&gt;
'''base = strtod(handles.ed_base.string)'''&lt;br /&gt;
&lt;br /&gt;
'''exponent = strtod(handles.ed_exponent.string)'''&lt;br /&gt;
&lt;br /&gt;
'''out = base^exponent'''&lt;br /&gt;
&lt;br /&gt;
'''handles.txt_output.string = string(out)'''&lt;br /&gt;
|&lt;br /&gt;
Enter the code as seen here with the same syntax.&lt;br /&gt;
&lt;br /&gt;
The same code can be found under the '''Code files''' section.&lt;br /&gt;
&lt;br /&gt;
You can use it as explained earlier in this tutorial.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''base = strtod(handles.ed_base.string)'''&lt;br /&gt;
| The first line assigns the user input for a base value to the variable ‘base’.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''exponent = strtod(handles.ed_exponent.string)'''&lt;br /&gt;
| The second line assigns the user input for an exponent to the variable ‘exponent’.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''SciNotes''' window,&lt;br /&gt;
&lt;br /&gt;
within '''pb_cal_callback.'''&lt;br /&gt;
&lt;br /&gt;
highlight '''strtod''' command.&lt;br /&gt;
|&lt;br /&gt;
It is not possible to do calculations when the value is in '''string''' format.&lt;br /&gt;
&lt;br /&gt;
Hence I have put the '''handles''' inside the '''strtod''' command.&lt;br /&gt;
&lt;br /&gt;
This command will convert the value from the '''string''' format to a '''decimal''' format.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''out = base^exponent'''&lt;br /&gt;
|&lt;br /&gt;
Notice the next line.&lt;br /&gt;
&lt;br /&gt;
This equation will perform the calculations.&lt;br /&gt;
&lt;br /&gt;
The final result will be stored in the variable ‘out’.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''handles.txt_output.string = string(out)'''&lt;br /&gt;
| The last line will give the value of a variable ‘out’ to the '''Text box'''.&lt;br /&gt;
|-&lt;br /&gt;
| Press '''Ctrl+S.'''&lt;br /&gt;
| Let us save all our work by pressing '''Control''' and '''S''' keys together.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Scinotes''' window,&lt;br /&gt;
&lt;br /&gt;
'''Execute'''&amp;amp;gt;&amp;amp;gt;'''file''' '''with echo'''&lt;br /&gt;
|&lt;br /&gt;
Execute this by clicking '''Execute''' on the '''menubar''' and then on '''File with echo'''.&lt;br /&gt;
&lt;br /&gt;
The '''Graphic window number 2''' opens.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 2,'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
delete '''Enter the base. '''&lt;br /&gt;
&lt;br /&gt;
Type '''4.'''&lt;br /&gt;
&lt;br /&gt;
Delete '''Enter an exponent.'''&lt;br /&gt;
&lt;br /&gt;
Type '''2'''.&lt;br /&gt;
|&lt;br /&gt;
Now let us test the '''GUI.'''&lt;br /&gt;
&lt;br /&gt;
I will calculate '''4''' to the '''power 2'''.&lt;br /&gt;
&lt;br /&gt;
Delete the '''string “Enter the base”''' from the '''Edit box''' and type '''4'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Delete the '''string “Enter an exponent”''' from the '''Edit box''' and type '''2'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 2,'''&lt;br /&gt;
&lt;br /&gt;
click on '''Calculate Pushbutton'''.&lt;br /&gt;
&lt;br /&gt;
Hover cursor over '''Text''' box.&lt;br /&gt;
|&lt;br /&gt;
Then click on the '''Calculate Pushbutton.'''&lt;br /&gt;
&lt;br /&gt;
The '''Text box''' shows the desired answer of '''16''' as we expected.&lt;br /&gt;
&lt;br /&gt;
This way we can perform numeric calculations using '''GUI''' in '''Scilab'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Summary'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
This brings us to the end of this tutorial. Let us summarise.&lt;br /&gt;
&lt;br /&gt;
In this tutorial, we have:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Calculated the exponent of a number using '''GUI''' and&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Used '''strtod''' command.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Assignment'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
As an assignment activity, please do the following.&lt;br /&gt;
&lt;br /&gt;
Create a '''GUI''' which has&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Two '''Edit boxes''' to take two numbers from the user.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Four '''pushbuttons''' to perform addition, subtraction, multiplication and division.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;One '''Text box''' to display the answer of these operations.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''About Spoken Tutorial Project'''&lt;br /&gt;
|&lt;br /&gt;
The video at the following link summarises the '''Spoken Tutorial''' project.&lt;br /&gt;
&lt;br /&gt;
Please download and watch it.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Spoken Tutorial Workshops'''&lt;br /&gt;
|&lt;br /&gt;
We conduct workshops using '''Spoken Tutorials''' and give certificates.&lt;br /&gt;
&lt;br /&gt;
Please contact us.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Answers for THIS Spoken Tutorial'''&lt;br /&gt;
| Please post your timed queries in this forum.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''FOSSEE Forum'''&lt;br /&gt;
| Please post your general and technical queries on '''Scilab''' in this forum.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Textbook Companion project'''&lt;br /&gt;
|&lt;br /&gt;
The '''FOSSEE''' team coordinates the '''TBC''' project.&lt;br /&gt;
&lt;br /&gt;
For more details, please visit these sites.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Lab Migration'''&lt;br /&gt;
|&lt;br /&gt;
The '''FOSSEE''' team coordinates the '''Lab Migration''' project.&lt;br /&gt;
&lt;br /&gt;
For more details, please visit this site.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Acknowledgement'''&lt;br /&gt;
| The '''Spoken Tutorial''' project is funded by the '''Ministry of Education, Government of India'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Thank you'''&lt;br /&gt;
|&lt;br /&gt;
This is '''Iswariya Sasikumar''', a '''FOSSEE''' intern 2021,IIT Bombay signing off.&lt;br /&gt;
&lt;br /&gt;
Thanks for joining.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Iswariyas</name></author>	</entry>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php/GUI-in-Scilab/C2/Creating-a-GUI-based-exponent-calculator/English</id>
		<title>GUI-in-Scilab/C2/Creating-a-GUI-based-exponent-calculator/English</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php/GUI-in-Scilab/C2/Creating-a-GUI-based-exponent-calculator/English"/>
				<updated>2021-09-15T11:00:59Z</updated>
		
		<summary type="html">&lt;p&gt;Iswariyas: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Title of script''': Creating a '''GUI''' based exponent calculator&lt;br /&gt;
&lt;br /&gt;
'''Author: Rashmi Patankar and Iswariya Sasikumar'''&lt;br /&gt;
&lt;br /&gt;
{| class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
! '''Visual Cue'''&lt;br /&gt;
! '''Narration'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Title Slide'''&lt;br /&gt;
|&lt;br /&gt;
Hello and welcome to the Spoken Tutorial on&lt;br /&gt;
&lt;br /&gt;
“'''Creating a GUI based exponent calculator”.'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Learning Objectives'''&lt;br /&gt;
|&lt;br /&gt;
In this tutorial, we will learn how to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Calculate the '''exponent''' of a number using '''GUI''' and&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Use of '''strtod command'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''System Requirements'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Only narration'''&lt;br /&gt;
|&lt;br /&gt;
To record this tutorial, I am using&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''Windows 10 OS'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''Scilab 6.1.0 and'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''GUI Builder Toolbox 4.2.1'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The process demonstrated in this tutorial is identical in '''Linux OS''' also.&lt;br /&gt;
&lt;br /&gt;
Annotations are added to the tutorial if there are any differences.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Pre-requisites'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
https://spoken-tutorial.org&lt;br /&gt;
|&lt;br /&gt;
To follow this tutorial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;The learner must have basic knowledge of '''Scilab''' and '''Graphical User Interface.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;For pre-requisite '''Scilab''' tutorials please visit this website.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Code Files'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;The files used in this tutorial are provided in the '''Code files''' link.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Please download and extract the files.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Make a copy and then use them while practising.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUIBuilder toolbox''',&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
hover cursor over '''GUIBuilder Palette''' window and '''Graphic window number 1'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
I have already opened the '''GUIBuilder toolbox.'''&lt;br /&gt;
&lt;br /&gt;
As we can see there are two windows.&lt;br /&gt;
&lt;br /&gt;
The '''GUIBuilder Palette''' window is located on the left side.&lt;br /&gt;
&lt;br /&gt;
The '''Graphic window number 1''' is on the right side.&lt;br /&gt;
&lt;br /&gt;
Let us start by creating the '''GUI'''.&lt;br /&gt;
|-&lt;br /&gt;
| Only narration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
To calculate the '''exponent''' of a number, we need two inputs.&lt;br /&gt;
&lt;br /&gt;
The first input is a '''base''' number and the second input is an '''exponent'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUIBuilder Palette''',&lt;br /&gt;
&lt;br /&gt;
click '''Edit.'''&lt;br /&gt;
| For the first input, go to the '''GUIBuilder Palette''' and click on '''Edit'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Scilab Multiple Values Request''' window,&lt;br /&gt;
&lt;br /&gt;
type '''ed_base''' in '''Tag''' field,&lt;br /&gt;
&lt;br /&gt;
type '''Enter''' '''the base''' in '''String''' field'''.'''&lt;br /&gt;
&lt;br /&gt;
Click on '''OK.'''&lt;br /&gt;
|&lt;br /&gt;
A window named '''Scilab Multiple Values Request''' will open.&lt;br /&gt;
&lt;br /&gt;
Type '''ed underscore base''' as the '''Tag''' and '''Enter the base''' as the '''String'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then click on '''OK'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 1,'''&lt;br /&gt;
&lt;br /&gt;
Place the '''Edit''' box in window's top left side.&lt;br /&gt;
&lt;br /&gt;
Hover cursor over an '''Edit''' box.&lt;br /&gt;
|&lt;br /&gt;
Switch to the '''Graphic window number 1'''.&lt;br /&gt;
&lt;br /&gt;
Place the '''Edit box''' in the window's top left side, by considering a suitable size.&lt;br /&gt;
&lt;br /&gt;
An '''Edit box''' with the '''string “Enter the base”''' appears.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUIBuilder palette''',&lt;br /&gt;
&lt;br /&gt;
click on '''Edit'''.&lt;br /&gt;
| Let us take another '''Edit box''' for the second input.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Scilab Multiple Values Request''' window''','''&lt;br /&gt;
&lt;br /&gt;
type '''ed_exponent''' in '''Tag''' field,&lt;br /&gt;
&lt;br /&gt;
type '''Enter''' '''an exponent''' in '''String''' field'''.'''&lt;br /&gt;
&lt;br /&gt;
Click on '''OK.'''&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I will type '''ed underscore exponent''' as the '''Tag''' and '''Enter''' '''an exponent''' as the '''String'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then click on '''OK'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 1,'''&lt;br /&gt;
&lt;br /&gt;
Place the '''Edit''' box in window's top right side.&lt;br /&gt;
&lt;br /&gt;
Hover cursor over an '''Edit''' box.&lt;br /&gt;
|&lt;br /&gt;
Consider a suitable size of the '''Edit''' box.&lt;br /&gt;
&lt;br /&gt;
Place it in the top right side of the '''Graphic window number 1'''.&lt;br /&gt;
&lt;br /&gt;
An '''Edit box''' with the '''string “Enter an exponent”''' appears.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUIBuilder Palette''' window,&lt;br /&gt;
&lt;br /&gt;
click on '''Text'''.&lt;br /&gt;
| To display '''output''', go to the '''GUIBuilder Palette''' and click on '''Text'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Scilab Multiple Values Request''' window,&lt;br /&gt;
&lt;br /&gt;
type '''txt_output''' in '''Tag''' field'''.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click on '''OK.'''&lt;br /&gt;
|&lt;br /&gt;
I will type '''txt underscore output''' as the '''Tag'''.&lt;br /&gt;
&lt;br /&gt;
Keep the '''String''' field empty.&lt;br /&gt;
&lt;br /&gt;
We will not display any messages until we receive from the '''user'''.&lt;br /&gt;
&lt;br /&gt;
Then click on '''OK'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 1,'''&lt;br /&gt;
&lt;br /&gt;
place the '''Text''' box at bottom.&lt;br /&gt;
&lt;br /&gt;
Hover cursor over '''Text''' box.&lt;br /&gt;
|&lt;br /&gt;
I will place the '''Text box''' at the bottom of the '''Graphic window number 1'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A '''Text box''' with the '''string “UnName3”''' appears.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUIBuilder Palette window''',&lt;br /&gt;
&lt;br /&gt;
click on '''Pushbutton'''.&lt;br /&gt;
|&lt;br /&gt;
To perform the calculations, I will add a '''pushbutton'''.&lt;br /&gt;
&lt;br /&gt;
Go to '''GUIBuilder Palette''' and click on '''Pushbutton'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On the '''Scilab Multiple Values Request''' window,&lt;br /&gt;
&lt;br /&gt;
type '''pb_cal''' in '''Tag''' field and type '''Calculate''' in '''String''' field'''.'''&lt;br /&gt;
&lt;br /&gt;
Click on '''OK.'''&lt;br /&gt;
|&lt;br /&gt;
Further I will type '''pb underscore cal''' as the '''Tag''' and '''Calculate''' as the '''String''' for the '''pushbutton'''.&lt;br /&gt;
&lt;br /&gt;
Then click on '''OK'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 1,'''&lt;br /&gt;
&lt;br /&gt;
place the '''Pushbutton''' in the middle.&lt;br /&gt;
&lt;br /&gt;
Hover cursor over '''Pushbutton.'''&lt;br /&gt;
&lt;br /&gt;
Hover cursor over two '''Edit''' boxes and '''Text''' box.&lt;br /&gt;
|&lt;br /&gt;
Let us place the '''Pushbutton''' in the middle of the '''Graphic window number 1'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A '''pushbutton''' with the '''string “Calculate”''' appears.&lt;br /&gt;
&lt;br /&gt;
As a result, the '''pushbutton''' has two '''Edit boxes''' above it and a '''Text box''' below it.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
| Now the '''GUI''' part is completed.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUIBuilder Palette''' window,&lt;br /&gt;
&lt;br /&gt;
'''Generate&amp;amp;gt;&amp;amp;gt;Generate GUI code.'''&lt;br /&gt;
|&lt;br /&gt;
To save this file, go to the '''GUIBuilder Palette'''.&lt;br /&gt;
&lt;br /&gt;
Click on '''Generate''' and then on the '''Generate GUI code'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''uiputfile''' window,&lt;br /&gt;
&lt;br /&gt;
save as '''exponent-calculator'''.&lt;br /&gt;
&lt;br /&gt;
Click on '''Save.'''&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I will save this file as '''exponent-calculator.'''&lt;br /&gt;
&lt;br /&gt;
Click on '''Save'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUI created window,'''&lt;br /&gt;
&lt;br /&gt;
click on '''OK.'''&lt;br /&gt;
|&lt;br /&gt;
A pop-up opens with the message “'''GUI created successfully'''.”&lt;br /&gt;
&lt;br /&gt;
Click on '''OK'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''SciNotes''' window,&lt;br /&gt;
&lt;br /&gt;
highlight '''handles''' for '''base, exponent output''' and '''Calculate'''.&lt;br /&gt;
|&lt;br /&gt;
We can see that the corresponding '''Scilab code''' has been generated.&lt;br /&gt;
&lt;br /&gt;
Notice the '''handles''' and '''properties''' of the objects we took on a '''graphic window'''.&lt;br /&gt;
|-&lt;br /&gt;
| Highlight '''handles.ed_base'''.&lt;br /&gt;
| '''handles dot ed underscore base''' is the '''handle''' for '''base'''.&lt;br /&gt;
|-&lt;br /&gt;
| Highlight '''handles.ed_exponent'''.&lt;br /&gt;
| '''handles dot ed underscore exponent''' is the '''handle''' for '''exponent'''.&lt;br /&gt;
|-&lt;br /&gt;
| Highlight '''handles.txt_output.'''.&lt;br /&gt;
| '''handles dot txt underscore output''' is the '''handle''' for '''output.'''&lt;br /&gt;
|-&lt;br /&gt;
| Highlight '''handles.pb_cal.'''&lt;br /&gt;
| '''handles dot pb underscore cal''' is the '''handle''' for '''Pushbutton.'''&lt;br /&gt;
|-&lt;br /&gt;
| Hover cursor over '''pb_cal_callback''' function.&lt;br /&gt;
| Now let us write a '''function definition''' for '''pb_cal_callback function'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Cursor on '''SciNotes''' window,&lt;br /&gt;
&lt;br /&gt;
type within '''pb_cal_callback'''.&lt;br /&gt;
&lt;br /&gt;
Type,&lt;br /&gt;
&lt;br /&gt;
'''base = strtod(handles.ed_base.string)'''&lt;br /&gt;
&lt;br /&gt;
'''exponent = strtod(handles.ed_exponent.string)'''&lt;br /&gt;
&lt;br /&gt;
'''out = base^exponent'''&lt;br /&gt;
&lt;br /&gt;
'''handles.txt_output.string = string(out)'''&lt;br /&gt;
|&lt;br /&gt;
Enter the code as seen here with the same syntax.&lt;br /&gt;
&lt;br /&gt;
The same code can be found under the '''Code files''' section.&lt;br /&gt;
&lt;br /&gt;
You can use it as explained earlier in this tutorial.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''base = strtod(handles.ed_base.string)'''&lt;br /&gt;
| The first line assigns the user input for a '''base''' value to the '''variable ‘base’'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''exponent = strtod(handles.ed_exponent.string)'''&lt;br /&gt;
| The second line assigns the user input for an '''exponent''' to the '''variable ‘exponent’'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''SciNotes''' window,&lt;br /&gt;
&lt;br /&gt;
within '''pb_cal_callback.'''&lt;br /&gt;
&lt;br /&gt;
highlight '''strtod''' command.&lt;br /&gt;
|&lt;br /&gt;
It is not possible to do calculations when the value is in '''string''' format.&lt;br /&gt;
&lt;br /&gt;
Hence I have put the '''handles''' inside the '''strtod command.'''&lt;br /&gt;
&lt;br /&gt;
This '''command''' will convert the value from the '''string''' format to a '''decimal''' format.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''out = base^exponent'''&lt;br /&gt;
|&lt;br /&gt;
Notice the next line.&lt;br /&gt;
&lt;br /&gt;
This equation will perform the calculations.&lt;br /&gt;
&lt;br /&gt;
The final result will be stored in the '''variable ‘out.''''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''handles.txt_output.string = string(out)'''&lt;br /&gt;
| The last line will give the value of a '''variable ‘out’''' to the '''Text box'''.&lt;br /&gt;
|-&lt;br /&gt;
| Press '''Ctrl+S.'''&lt;br /&gt;
| Let us save all our work by pressing '''Control''' and '''S''' keys together.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Scinotes''' window,&lt;br /&gt;
&lt;br /&gt;
'''Execute'''&amp;amp;gt;&amp;amp;gt;'''file''' '''with echo'''&lt;br /&gt;
|&lt;br /&gt;
'''Execute''' this by clicking '''Execute''' on the '''menubar''' and then on '''File with echo'''.&lt;br /&gt;
&lt;br /&gt;
The '''Graphic window number 2''' opens.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 2,'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
delete '''Enter the base. '''&lt;br /&gt;
&lt;br /&gt;
Type '''4.'''&lt;br /&gt;
&lt;br /&gt;
Delete '''Enter an exponent.'''&lt;br /&gt;
&lt;br /&gt;
Type '''2'''.&lt;br /&gt;
|&lt;br /&gt;
Now let us test the '''GUI.'''&lt;br /&gt;
&lt;br /&gt;
I will calculate '''4''' to the '''power 2'''.&lt;br /&gt;
&lt;br /&gt;
Delete the '''string “Enter the base”''' from the '''Edit box''' and type '''4'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Delete the '''string “Enter an exponent”''' from the '''Edit box''' and type '''2'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 2,'''&lt;br /&gt;
&lt;br /&gt;
click on '''Calculate Pushbutton'''.&lt;br /&gt;
&lt;br /&gt;
Hover cursor over '''Text''' box.&lt;br /&gt;
|&lt;br /&gt;
Then click on the '''Calculate Pushbutton.'''&lt;br /&gt;
&lt;br /&gt;
The '''Text box''' shows the desired answer of '''16''' as we expected.&lt;br /&gt;
&lt;br /&gt;
This way we can perform numeric calculations using '''GUI''' in '''Scilab'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Summary'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
This brings us to the end of this tutorial. Let us summarise.&lt;br /&gt;
&lt;br /&gt;
In this tutorial, we have:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Calculated the '''exponent''' of a number using '''GUI''' and&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Used '''strtod command'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Assignment'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
As an assignment activity, please do the following.&lt;br /&gt;
&lt;br /&gt;
Create a '''GUI''' which has&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Two '''Edit boxes''' to take two numbers from the '''user'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Four '''pushbuttons''' to perform '''addition''', '''subtraction''', '''multiplication''' and '''division'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;One '''Text box''' to display the answer of these operations.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''About Spoken Tutorial Project'''&lt;br /&gt;
|&lt;br /&gt;
The video at the following link summarises the '''Spoken Tutorial''' project.&lt;br /&gt;
&lt;br /&gt;
Please download and watch it.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Spoken Tutorial Workshops'''&lt;br /&gt;
|&lt;br /&gt;
We conduct workshops using '''Spoken Tutorials''' and give certificates.&lt;br /&gt;
&lt;br /&gt;
Please contact us.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Answers for THIS Spoken Tutorial'''&lt;br /&gt;
| Please post your timed queries in this forum.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''FOSSEE Forum'''&lt;br /&gt;
| Please post your general and technical queries on '''Scilab''' in this forum.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Textbook Companion project'''&lt;br /&gt;
|&lt;br /&gt;
The '''FOSSEE''' team coordinates the '''TBC''' project.&lt;br /&gt;
&lt;br /&gt;
For more details, please visit these sites.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Lab Migration'''&lt;br /&gt;
|&lt;br /&gt;
The '''FOSSEE''' team coordinates the '''Lab Migration''' project.&lt;br /&gt;
&lt;br /&gt;
For more details, please visit this site.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Acknowledgement'''&lt;br /&gt;
| The '''Spoken Tutorial''' project is funded by the '''Ministry of Education, Government of India'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Thank you'''&lt;br /&gt;
|&lt;br /&gt;
This is '''Iswariya Sasikumar''', a '''FOSSEE''' intern 2021,IIT Bombay signing off.&lt;br /&gt;
&lt;br /&gt;
Thanks for joining.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Iswariyas</name></author>	</entry>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php/GUI-in-Scilab/C2/Creating-a-GUI-based-exponent-calculator/English</id>
		<title>GUI-in-Scilab/C2/Creating-a-GUI-based-exponent-calculator/English</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php/GUI-in-Scilab/C2/Creating-a-GUI-based-exponent-calculator/English"/>
				<updated>2021-09-15T10:38:28Z</updated>
		
		<summary type="html">&lt;p&gt;Iswariyas: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Title of script''': Creating a '''GUI''' based exponent calculator&lt;br /&gt;
&lt;br /&gt;
'''Author: Rashmi Patankar and Iswariya Sasikumar'''&lt;br /&gt;
&lt;br /&gt;
{| class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
! '''Visual Cue'''&lt;br /&gt;
! '''Narration'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Title Slide'''&lt;br /&gt;
|&lt;br /&gt;
Hello and welcome to the Spoken Tutorial on&lt;br /&gt;
&lt;br /&gt;
“'''Creating a GUI based exponent calculator”.'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Learning Objectives'''&lt;br /&gt;
|&lt;br /&gt;
In this tutorial, we will learn how to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Calculate the '''exponent''' of a number using '''GUI''' and&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Use of '''strtod command'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''System Requirements'''&lt;br /&gt;
&lt;br /&gt;
'''Only narration'''&lt;br /&gt;
|&lt;br /&gt;
To record this tutorial, I am using&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''Windows 10 OS'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''Scilab 6.1.0 and'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''GUI Builder Toolbox 4.2.1'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The process demonstrated in this tutorial is identical in '''Linux OS''' also.&lt;br /&gt;
&lt;br /&gt;
Annotations are added to the tutorial if there are any differences.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Pre-requisites'''&lt;br /&gt;
&lt;br /&gt;
https://spoken-tutorial.org&lt;br /&gt;
|&lt;br /&gt;
To follow this tutorial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;The learner must have basic knowledge of '''Scilab''' and '''Graphical User Interface.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;For pre-requisite '''Scilab''' tutorials please visit this website.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Code Files'''&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;The files used in this tutorial are provided in the '''Code files''' link.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Please download and extract the files.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Make a copy and then use them while practising.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUIBuilder toolbox''',&lt;br /&gt;
&lt;br /&gt;
hover cursor over '''GUIBuilder Palette''' window and '''Graphic window number 1'''.&lt;br /&gt;
|&lt;br /&gt;
I have already opened the '''GUIBuilder toolbox.'''&lt;br /&gt;
&lt;br /&gt;
As we can see there are two windows.&lt;br /&gt;
&lt;br /&gt;
The '''GUIBuilder Palette''' window is located on the left side.&lt;br /&gt;
&lt;br /&gt;
The '''Graphic window number 1''' is on the right side.&lt;br /&gt;
&lt;br /&gt;
Let us start by creating the '''GUI'''.&lt;br /&gt;
|-&lt;br /&gt;
| Only narration&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
To calculate the '''exponent''' of a number, we need two inputs.&lt;br /&gt;
&lt;br /&gt;
The first input is a '''base''' number and the second input is an '''exponent'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUIBuilder Palette''',&lt;br /&gt;
&lt;br /&gt;
click '''Edit.'''&lt;br /&gt;
| For the first input, go to the '''GUIBuilder Palette''' and click on '''Edit'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Scilab Multiple Values Request''' window,&lt;br /&gt;
&lt;br /&gt;
type '''ed_base''' in '''Tag''' field,&lt;br /&gt;
&lt;br /&gt;
type '''Enter''' '''the base''' in '''String''' field'''.'''&lt;br /&gt;
&lt;br /&gt;
Click on '''OK.'''&lt;br /&gt;
|&lt;br /&gt;
A window named '''Scilab Multiple Values Request''' will open.&lt;br /&gt;
&lt;br /&gt;
Type '''ed underscore base''' as the '''Tag''' and '''Enter the base''' as the '''String'''.&lt;br /&gt;
&lt;br /&gt;
Then click on '''OK'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 1,'''&lt;br /&gt;
&lt;br /&gt;
Place the '''Edit''' box in window's top left side.&lt;br /&gt;
&lt;br /&gt;
Hover cursor over an '''Edit''' box.&lt;br /&gt;
|&lt;br /&gt;
Switch to the '''Graphic window number 1'''.&lt;br /&gt;
&lt;br /&gt;
Place the '''Edit box''' in the window's top left side, by considering a suitable size.&lt;br /&gt;
&lt;br /&gt;
An '''Edit box''' with the '''string “Enter the base”''' appears.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUIBuilder palette''',&lt;br /&gt;
&lt;br /&gt;
click on '''Edit'''.&lt;br /&gt;
| Let us take another '''Edit box''' for the second input.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Scilab Multiple Values Request''' window''','''&lt;br /&gt;
&lt;br /&gt;
type '''ed_exponent''' in '''Tag''' field,&lt;br /&gt;
&lt;br /&gt;
type '''Enter''' '''an exponent''' in '''String''' field'''.'''&lt;br /&gt;
&lt;br /&gt;
Click on '''OK.'''&lt;br /&gt;
|&lt;br /&gt;
I will type '''ed underscore exponent''' as the '''Tag''' and '''Enter''' '''an exponent''' as the '''String'''.&lt;br /&gt;
&lt;br /&gt;
Then click on '''OK'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 1,'''&lt;br /&gt;
&lt;br /&gt;
Place the '''Edit''' box in window's top right side.&lt;br /&gt;
&lt;br /&gt;
Hover cursor over an '''Edit''' box.&lt;br /&gt;
|&lt;br /&gt;
Consider a suitable size of the '''Edit''' box.&lt;br /&gt;
&lt;br /&gt;
Place it in the top right side of the '''Graphic window number 1'''.&lt;br /&gt;
&lt;br /&gt;
An '''Edit box''' with the '''string “Enter an exponent”''' appears.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUIBuilder Palette''' window,&lt;br /&gt;
&lt;br /&gt;
click on '''Text'''.&lt;br /&gt;
| To display '''output''', go to the '''GUIBuilder Palette''' and click on '''Text'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Scilab Multiple Values Request''' window,&lt;br /&gt;
&lt;br /&gt;
type '''txt_output''' in '''Tag''' field'''.'''&lt;br /&gt;
&lt;br /&gt;
Click on '''OK.'''&lt;br /&gt;
|&lt;br /&gt;
I will type '''txt underscore output''' as the '''Tag'''.&lt;br /&gt;
&lt;br /&gt;
Keep the '''String''' field empty.&lt;br /&gt;
&lt;br /&gt;
We will not display any messages until we receive from the '''user'''.&lt;br /&gt;
&lt;br /&gt;
Then click on '''OK'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 1,'''&lt;br /&gt;
&lt;br /&gt;
place the '''Text''' box at bottom.&lt;br /&gt;
&lt;br /&gt;
Hover cursor over '''Text''' box.&lt;br /&gt;
|&lt;br /&gt;
I will place the '''Text box''' at the bottom of the '''Graphic window number 1'''.&lt;br /&gt;
&lt;br /&gt;
A '''Text box''' with the '''string “UnName3”''' appears.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUIBuilder Palette window''',&lt;br /&gt;
&lt;br /&gt;
click on '''Pushbutton'''.&lt;br /&gt;
|&lt;br /&gt;
To perform the calculations, I will add a '''pushbutton'''.&lt;br /&gt;
&lt;br /&gt;
Go to '''GUIBuilder Palette''' and click on '''Pushbutton'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On the '''Scilab Multiple Values Request''' window,&lt;br /&gt;
&lt;br /&gt;
type '''pb_cal''' in '''Tag''' field and type '''Calculate''' in '''String''' field'''.'''&lt;br /&gt;
&lt;br /&gt;
Click on '''OK.'''&lt;br /&gt;
|&lt;br /&gt;
Further I will type '''pb underscore cal''' as the '''Tag''' and '''Calculate''' as the '''String''' for the '''pushbutton'''.&lt;br /&gt;
&lt;br /&gt;
Then click on '''OK'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 1,'''&lt;br /&gt;
&lt;br /&gt;
place the '''Pushbutton''' in the middle.&lt;br /&gt;
&lt;br /&gt;
Hover cursor over '''Pushbutton.'''&lt;br /&gt;
&lt;br /&gt;
Hover cursor over two '''Edit''' boxes and '''Text''' box.&lt;br /&gt;
|&lt;br /&gt;
Let us place the '''Pushbutton''' in the middle of the '''Graphic window number 1'''.&lt;br /&gt;
&lt;br /&gt;
A '''pushbutton''' with the '''string “Calculate”''' appears.&lt;br /&gt;
&lt;br /&gt;
As a result, the '''pushbutton''' has two '''Edit boxes''' above it and a '''Text box''' below it.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
| Now the '''GUI''' part is completed.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUIBuilder Palette''' window,&lt;br /&gt;
&lt;br /&gt;
'''Generate&amp;amp;gt;&amp;amp;gt;Generate GUI code.'''&lt;br /&gt;
|&lt;br /&gt;
To save this file, go to the '''GUIBuilder Palette'''.&lt;br /&gt;
&lt;br /&gt;
Click on '''Generate''' and then on the '''Generate GUI code'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''uiputfile''' window,&lt;br /&gt;
&lt;br /&gt;
save as '''exponent-calculator'''.&lt;br /&gt;
&lt;br /&gt;
Click on '''Save.'''&lt;br /&gt;
&lt;br /&gt;
Video-editor: Pls put a textbox on screen. “In Ubuntu Linux OS, click on Ok button.”&lt;br /&gt;
|&lt;br /&gt;
I will save this file as '''exponent-calculator.'''&lt;br /&gt;
&lt;br /&gt;
Click on '''Save'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUI created window,'''&lt;br /&gt;
&lt;br /&gt;
click on '''OK.'''&lt;br /&gt;
|&lt;br /&gt;
A pop-up opens with the message “'''GUI created successfully'''.”&lt;br /&gt;
&lt;br /&gt;
Click on '''OK'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''SciNotes''' window,&lt;br /&gt;
&lt;br /&gt;
highlight '''handles''' for '''base, exponent output''' and '''Calculate'''.&lt;br /&gt;
|&lt;br /&gt;
We can see that the corresponding '''Scilab code''' has been generated.&lt;br /&gt;
&lt;br /&gt;
Notice the '''handles''' and '''properties''' of the objects we took on a '''graphic window'''.&lt;br /&gt;
|-&lt;br /&gt;
| Highlight '''handles.ed_base'''.&lt;br /&gt;
| '''handles dot ed underscore base''' is the '''handle''' for '''base'''.&lt;br /&gt;
|-&lt;br /&gt;
| Highlight '''handles.ed_exponent'''.&lt;br /&gt;
| '''handles dot ed underscore exponent''' is the '''handle''' for '''exponent'''.&lt;br /&gt;
|-&lt;br /&gt;
| Highlight '''handles.txt_output.'''.&lt;br /&gt;
| '''handles dot txt underscore output''' is the '''handle''' for '''output.'''&lt;br /&gt;
|-&lt;br /&gt;
| Highlight '''handles.pb_cal.'''&lt;br /&gt;
| '''handles dot pb underscore cal''' is the '''handle''' for '''Pushbutton.'''&lt;br /&gt;
|-&lt;br /&gt;
| Hover cursor over '''pb_cal_callback''' function.&lt;br /&gt;
| Now let us write a '''function definition''' for '''pb_cal_callback function'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Cursor on '''SciNotes''' window,&lt;br /&gt;
&lt;br /&gt;
type within '''pb_cal_callback'''.&lt;br /&gt;
&lt;br /&gt;
Type,&lt;br /&gt;
&lt;br /&gt;
'''base = strtod(handles.ed_base.string)'''&lt;br /&gt;
&lt;br /&gt;
'''exponent = strtod(handles.ed_exponent.string)'''&lt;br /&gt;
&lt;br /&gt;
'''out = base^exponent'''&lt;br /&gt;
&lt;br /&gt;
'''handles.txt_output.string = string(out)'''&lt;br /&gt;
|&lt;br /&gt;
Enter the code as seen here with the same syntax.&lt;br /&gt;
&lt;br /&gt;
The same code can be found under the '''Code files''' section.&lt;br /&gt;
&lt;br /&gt;
You can use it as explained earlier in this tutorial.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''base = strtod(handles.ed_base.string)'''&lt;br /&gt;
| The first line assigns the user input for a '''base''' value to the '''variable ‘base’'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''exponent = strtod(handles.ed_exponent.string)'''&lt;br /&gt;
| The second line assigns the user input for an '''exponent''' to the '''variable ‘exponent’'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''SciNotes''' window,&lt;br /&gt;
&lt;br /&gt;
within '''pb_cal_callback.'''&lt;br /&gt;
&lt;br /&gt;
highlight '''strtod''' command.&lt;br /&gt;
|&lt;br /&gt;
It is not possible to do calculations when the value is in '''string''' format.&lt;br /&gt;
&lt;br /&gt;
Hence I have put the '''handles''' inside the '''strtod command.'''&lt;br /&gt;
&lt;br /&gt;
This '''command''' will convert the value from the '''string''' format to a '''decimal''' format.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''out = base^exponent'''&lt;br /&gt;
|&lt;br /&gt;
Notice the next line.&lt;br /&gt;
&lt;br /&gt;
This equation will perform the calculations.&lt;br /&gt;
&lt;br /&gt;
The final result will be stored in the '''variable ‘out.''''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''handles.txt_output.string = string(out)'''&lt;br /&gt;
| The last line will give the value of a '''variable ‘out’''' to the '''Text box'''.&lt;br /&gt;
|-&lt;br /&gt;
| Press '''Ctrl+S.'''&lt;br /&gt;
| Let us save all our work by pressing '''Control''' and '''S''' keys together.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Scinotes''' window,&lt;br /&gt;
&lt;br /&gt;
'''Execute'''&amp;amp;gt;&amp;amp;gt;'''file''' '''with echo'''&lt;br /&gt;
|&lt;br /&gt;
'''Execute''' this by clicking '''Execute''' on the '''menubar''' and then on '''File with echo'''.&lt;br /&gt;
&lt;br /&gt;
The '''Graphic window number 2''' opens.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 2,'''&lt;br /&gt;
&lt;br /&gt;
delete '''Enter the base. '''&lt;br /&gt;
&lt;br /&gt;
Type '''2.'''&lt;br /&gt;
&lt;br /&gt;
Delete '''Enter an exponent.'''&lt;br /&gt;
&lt;br /&gt;
Type '''4'''.&lt;br /&gt;
|&lt;br /&gt;
Now let us test the '''GUI.'''&lt;br /&gt;
&lt;br /&gt;
I will calculate '''4''' to the '''power 2'''.&lt;br /&gt;
&lt;br /&gt;
Delete the '''string “Enter the base”''' from the '''Edit box''' and type '''4'''.&lt;br /&gt;
&lt;br /&gt;
Delete the '''string “Enter an exponent”''' from the '''Edit box''' and type '''2'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 2,'''&lt;br /&gt;
&lt;br /&gt;
click on '''Calculate Pushbutton'''.&lt;br /&gt;
&lt;br /&gt;
Hover cursor over '''Text''' box.&lt;br /&gt;
|&lt;br /&gt;
Then click on the '''Calculate Pushbutton.'''&lt;br /&gt;
&lt;br /&gt;
The '''Text box''' shows the desired answer of '''16''' as we expected.&lt;br /&gt;
&lt;br /&gt;
This way we can perform numeric calculations using '''GUI''' in '''Scilab'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Summary'''&lt;br /&gt;
|&lt;br /&gt;
This brings us to the end of this tutorial. Let us summarise.&lt;br /&gt;
&lt;br /&gt;
In this tutorial, we have:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Calculated the '''exponent''' of a number using '''GUI''' and&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Used '''strtod command'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Assignment'''&lt;br /&gt;
|&lt;br /&gt;
As an assignment activity, please do the following.&lt;br /&gt;
&lt;br /&gt;
Create a '''GUI''' which has&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Two '''Edit boxes''' to take two numbers from the '''user'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Four '''pushbuttons''' to perform '''addition''', '''subtraction''', '''multiplication''' and '''division'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;One '''Text box''' to display the answer of these operations.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''About Spoken Tutorial Project'''&lt;br /&gt;
|&lt;br /&gt;
The video at the following link summarises the '''Spoken Tutorial''' project.&lt;br /&gt;
&lt;br /&gt;
Please download and watch it.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Spoken Tutorial Workshops'''&lt;br /&gt;
|&lt;br /&gt;
We conduct workshops using '''Spoken Tutorials''' and give certificates.&lt;br /&gt;
&lt;br /&gt;
Please contact us.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Answers for THIS Spoken Tutorial'''&lt;br /&gt;
| Please post your timed queries in this forum.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''FOSSEE Forum'''&lt;br /&gt;
| Please post your general and technical queries on '''Scilab''' in this forum.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Textbook Companion project'''&lt;br /&gt;
|&lt;br /&gt;
The '''FOSSEE''' team coordinates the '''TBC''' project.&lt;br /&gt;
&lt;br /&gt;
For more details, please visit these sites.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Lab Migration'''&lt;br /&gt;
|&lt;br /&gt;
The '''FOSSEE''' team coordinates the '''Lab Migration''' project.&lt;br /&gt;
&lt;br /&gt;
For more details, please visit this site.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Acknowledgement'''&lt;br /&gt;
| The '''Spoken Tutorial''' project is funded by the '''Ministry of Education, Government of India'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Thank you'''&lt;br /&gt;
|&lt;br /&gt;
This is '''Iswariya Sasikumar''', a '''FOSSEE''' intern 2021,IIT Bombay signing off.&lt;br /&gt;
&lt;br /&gt;
Thanks for joining.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Iswariyas</name></author>	</entry>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php/Scilab/C4/User-defined-variables-in-Xcos/English</id>
		<title>Scilab/C4/User-defined-variables-in-Xcos/English</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php/Scilab/C4/User-defined-variables-in-Xcos/English"/>
				<updated>2021-08-30T12:51:38Z</updated>
		
		<summary type="html">&lt;p&gt;Iswariyas: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Title of script: User-defined variables in Xcos'''&lt;br /&gt;
&lt;br /&gt;
'''Author:Rupak Rokade and Anandajith TS'''&lt;br /&gt;
&lt;br /&gt;
{| class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
! '''Visual Cue'''&lt;br /&gt;
! '''Narration'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Title Slide'''&lt;br /&gt;
| Hello and welcome to the Spoken Tutorial on “ '''User-defined Variables in Xcos'''”&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Learning Objectives'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
In this tutorial, we will learn how to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Pass '''variables''' from '''Scilab Console''' to '''Xcos.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Pass '''variables''' from '''context menu''' to '''Xcos.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''System Requirements'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
To record this tutorial, I am using&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''Windows 10 OS'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''Scilab 6.1.0'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The process demonstrated in this&lt;br /&gt;
&lt;br /&gt;
tutorial is identical in '''Linux''' OS also&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Prerequisite'''&lt;br /&gt;
&lt;br /&gt;
https://www.spoken-tutorial.org&lt;br /&gt;
|&lt;br /&gt;
Before practising this tutorial, a learner should have :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Basic knowledge of '''Scilab and Xcos.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If not, then go through the '''Scilab''' spoken tutorials on this website.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Variables'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
There are two ways to define '''variables''' in '''Xcos''':&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Defining variables from the '''Scilab Console.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Defining variables from the context '''menu.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
| First we will create a simple '''simulation.'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show slide:&lt;br /&gt;
&lt;br /&gt;
'''Simulation - Blocks used'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
For this we used the below blocks&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''RAMP'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''CLOCK underscore c''' and&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''CSCOPE'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Show '''Scilab workspace window'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
Open '''Scilab.'''&lt;br /&gt;
&lt;br /&gt;
Type in '''‘xcos'''’ in the '''Scilab console''' and press '''enter.'''&lt;br /&gt;
&lt;br /&gt;
Two windows will open :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''Palette browser''' and the&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''Untitled-Xcos window.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show '''Xcos window'''&lt;br /&gt;
&lt;br /&gt;
'''Sources palette&amp;amp;gt;&amp;amp;gt;RAMP block'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
To create the '''simulation''' we will have to import the necessary '''blocks.'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;In the '''Palette browser-Xcos''' window, click on '''Sources''' palette.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;In the right panel, select the '''RAMP''' block.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Now, drag and drop this block in the '''Untitled-Xcos''' window.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| '''Sinks palette&amp;amp;gt;&amp;amp;gt;CSCOPE block'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Go to the '''Palette browser-Xcos window'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Click on the '''sinks palette'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;In the right panel, scroll down and select the '''CSCOPE''' block.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Drag and drop it next to the '''RAMP''' block in the '''Untitled-Xcos window'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| '''Event handling&amp;amp;gt;&amp;amp;gt;Clock_c block'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Again go to the '''event handling palette''', select the '''CLOCK underscore c block.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Then drag and drop it above the '''CSCOPE block''' in the '''untitled -Xcos window'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Show '''Xcos window'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
Next we will interconnect all the '''blocks.'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Connect black '''output''' port of '''RAMP''' to black '''input''' port of '''CSCOPE.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Connect the red '''output''' port of '''CLOCK underscore c''' to the red '''input''' port of '''CSCOPE'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Our simulation is ready.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Show '''Xcos window'''&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Then right click on the RAMP '''block''' and select the block '''parameters.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Here we set the '''slope parameter''' to '''‘a’''' and click '''OK''' .&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;It shows an error as '''‘a’''' is not defined.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;This is correct because we never defined the '''variable ‘a’''' before.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| '''Show Scilab workspace window'''&lt;br /&gt;
|&lt;br /&gt;
Our first way to define a '''variable''' is using the '''Scilab console.'''&lt;br /&gt;
&lt;br /&gt;
For this, go to the '''Scilab console''' .&lt;br /&gt;
&lt;br /&gt;
Type '''‘a=1’''' and press '''enter'''&lt;br /&gt;
|-&lt;br /&gt;
| '''Show Xcos window'''&lt;br /&gt;
|&lt;br /&gt;
Now come back to the '''Untitled-Xcos window''' .&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Right click on the '''RAMP block''' and select the '''block parameter''' option in the menu.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Again we set the '''slope parameter''' to '''‘a’''' and click '''ok.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
To start the '''simulation''', go to the toolbar of the '''Untitled-Xcos window'''.&lt;br /&gt;
&lt;br /&gt;
Then click on the '''Start''' button that is of the shape of the play button.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
We will see a '''warning message''' saying that there is '''no continuous time state'''.&lt;br /&gt;
&lt;br /&gt;
This can be ignored in this example. So click on '''OK.'''&lt;br /&gt;
|-&lt;br /&gt;
| '''Show graphic window'''&lt;br /&gt;
| Now, we can see that the '''slope''' of the output '''RAMP signal''' changes to '''a''' in the graphic window.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
Next we will see how to define variables&lt;br /&gt;
&lt;br /&gt;
using the '''context menu''' in the '''Xcos toolbar.'''&lt;br /&gt;
|-&lt;br /&gt;
| Show '''workspace window'''&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;blockquote&amp;gt;First we will have to clear the previous value of '''a'''. For this :&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Go to the '''scilab console window'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Type in '''‘clear a’''' in the '''console''' and press '''enter''' .&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Now type '''‘a’''' and press Enter&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;We can see that the '''console''' shows ‘'''a’''' as undefined.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show '''Xcos window''' and '''context menu'''&lt;br /&gt;
&lt;br /&gt;
'''a=1'''&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Next, in the menu bar of the '''Untitled-Xcos window,''' click on '''Simulation'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;In the drop down menu select the '''set context''' option.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''set context''' popup window appears.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Type a=1 in the window and click ok.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Show '''Xcos window'''&lt;br /&gt;
|&lt;br /&gt;
Now we execute the simulation again''':'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Go to the '''toolbar''' and click '''start.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Click '''ok''' in the warning window.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Then switch to the graphic window&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;We can see that the '''slope''' of '''output RAMP''' changed to '''‘a’'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide :&lt;br /&gt;
&lt;br /&gt;
'''Advantages of Context menu'''&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Using the '''set context menu''' we can include the variables in the simulation itself.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;We need not carry an additional '''sci file''' just to initialize the variable.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Summary'''&lt;br /&gt;
|&lt;br /&gt;
This brings us to the end of this tutorial. Let us summarise.&lt;br /&gt;
&lt;br /&gt;
In this tutorial, we have learnt to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Pass variables from '''Scilab''' '''Console''' to '''Xcos.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Pass variables from '''context menu''' to '''Xcos.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show slide ;&lt;br /&gt;
&lt;br /&gt;
'''Assignment'''&lt;br /&gt;
|&lt;br /&gt;
As an assignment, please do the following&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Change the value of variable ‘a’ to 5 using the Console window and context menu.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Check the output in the graphic window.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''About Spoken Tutorial Project'''&lt;br /&gt;
|&lt;br /&gt;
The video at the following link summarises the '''Spoken Tutorial''' project.&lt;br /&gt;
&lt;br /&gt;
Please download and watch it.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Spoken Tutorial Workshops'''&lt;br /&gt;
|&lt;br /&gt;
The '''Spoken Tutorial''' Project Team conducts workshops and gives certificates.&lt;br /&gt;
&lt;br /&gt;
For more details, please write to us&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Answers for THIS Spoken Tutorial'''&lt;br /&gt;
| Please post your timed queries in this forum.&lt;br /&gt;
|-&lt;br /&gt;
| Show Slide: '''FOSSEE Forum'''&lt;br /&gt;
| Please post your general and technical queries on '''Scilab''' in this forum.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Textbook Companion project'''&lt;br /&gt;
|&lt;br /&gt;
The '''FOSSEE''' team coordinates the '''Textbook Companion project'''.&lt;br /&gt;
&lt;br /&gt;
We give '''Certificates''' and '''Honorarium''' to the contributors.&lt;br /&gt;
&lt;br /&gt;
For more details, please visit this site..&lt;br /&gt;
|-&lt;br /&gt;
| Show Slide: '''Lab Migration'''&lt;br /&gt;
|&lt;br /&gt;
The '''FOSSEE''' team coordinates the '''Lab Migration project'''.&lt;br /&gt;
&lt;br /&gt;
For more details, please visit this site.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Acknowledgement'''&lt;br /&gt;
| '''Spoken Tutorial''' and '''FOSSEE''' projects are funded by '''MoE, Government of India'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide :&lt;br /&gt;
&lt;br /&gt;
'''Thank you'''&lt;br /&gt;
|&lt;br /&gt;
This is '''Iswariya Sasikumar''', a FOSSEE intern 2021, IIT Bombay signing off.&lt;br /&gt;
&lt;br /&gt;
Thanks for joining.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Iswariyas</name></author>	</entry>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php/Scilab/C4/User-defined-variables-in-Xcos/English</id>
		<title>Scilab/C4/User-defined-variables-in-Xcos/English</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php/Scilab/C4/User-defined-variables-in-Xcos/English"/>
				<updated>2021-08-30T12:45:28Z</updated>
		
		<summary type="html">&lt;p&gt;Iswariyas: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Title of script: User-defined variables in Xcos'''&lt;br /&gt;
&lt;br /&gt;
'''Author:Rupak Rokade and Anandajith TS'''&lt;br /&gt;
&lt;br /&gt;
{| class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
! '''Visual Cue'''&lt;br /&gt;
! '''Narration'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Title Slide'''&lt;br /&gt;
| Hello and welcome to the Spoken Tutorial on “ '''User-defined Variables in Xcos'''”&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Learning Objectives'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
In this tutorial, we will learn how to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Pass '''variables''' from '''Scilab Console''' to '''Xcos.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Pass '''variables''' from '''context menu''' to '''Xcos.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''System Requirements'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
To record this tutorial, I am using&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''Windows 10 OS'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''Scilab 6.1.0'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The process demonstrated in this&lt;br /&gt;
&lt;br /&gt;
tutorial is identical in '''Linux''' OS also&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Prerequisite'''&lt;br /&gt;
&lt;br /&gt;
https://www.spoken-tutorial.org&lt;br /&gt;
|&lt;br /&gt;
Before practising this tutorial, a learner should have :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Basic knowledge of '''Scilab and Xcos.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If not, then go through the '''Scilab''' spoken tutorials on this website.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Variables'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
There are two ways to define '''variables''' in '''Xcos''':&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Defining variables from the '''Scilab Console.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Defining variables from the context '''menu.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
| First we will create a simple '''simulation.'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show slide:&lt;br /&gt;
&lt;br /&gt;
'''Simulation - Blocks used'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
For this we used the below blocks&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''RAMP'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''CLOCK underscore c''' and&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''CSCOPE'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Show '''Scilab workspace window'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
Open '''Scilab.'''&lt;br /&gt;
&lt;br /&gt;
Type in '''‘xcos'''’ in the '''Scilab console''' and press '''enter.'''&lt;br /&gt;
&lt;br /&gt;
Two windows will open :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''Palette browser''' and the&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''Untitled-Xcos window.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show '''Xcos window'''&lt;br /&gt;
&lt;br /&gt;
'''Sources palette&amp;amp;gt;&amp;amp;gt;RAMP block'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
To create the '''simulation''' we will have to import the necessary '''blocks.'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;In the '''Palette browser-Xcos''' window, click on '''Sources''' palette.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;In the right panel, select the '''RAMP''' block.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Now, drag and drop this block in the '''Untitled-Xcos''' window.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| '''Sinks palette&amp;amp;gt;&amp;amp;gt;CSCOPE block'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Go to the '''Palette browser-Xcos window'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Click on the '''sinks palette'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;In the right panel, scroll down and select the '''CSCOPE''' block.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Drag and drop it next to the '''RAMP''' block in the '''Untitled-Xcos window'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| '''Event handling&amp;amp;gt;&amp;amp;gt;Clock_c block'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Again go to the '''event handling palette''', select the '''CLOCK underscore c block.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Then drag and drop it above the '''CSCOPE block''' in the '''untitled -Xcos window'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Show '''Xcos window'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
Next we will interconnect all the '''blocks.'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Connect black '''output''' port of '''RAMP''' to black '''input''' port of '''CSCOPE.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Connect the red '''output''' port of '''CLOCK underscore c''' to the red '''input''' port of '''CSCOPE'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Our simulation is ready.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Show '''Xcos window'''&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Then right click on the RAMP '''block''' and select the block '''parameters.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Here we set the '''slope parameter''' to '''‘a’''' and click '''OK''' .&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;It shows an error as '''‘a’''' is not defined.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;This is correct because we never defined the '''variable ‘a’''' before.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| '''Show Scilab workspace window'''&lt;br /&gt;
|&lt;br /&gt;
Our first way to define a '''variable''' is using the '''Scilab console.'''&lt;br /&gt;
&lt;br /&gt;
For this, go to the '''Scilab console''' .&lt;br /&gt;
&lt;br /&gt;
Type '''‘a=1’''' and press '''enter'''&lt;br /&gt;
|-&lt;br /&gt;
| '''Show Xcos window'''&lt;br /&gt;
|&lt;br /&gt;
Now come back to the '''Untitled-Xcos window''' .&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Right click on the '''RAMP block''' and select the '''block parameter''' option in the menu.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Again we set the '''slope parameter''' to '''‘a’''' and click '''ok.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
To start the '''simulation''', go to the toolbar of the '''Untitled-Xcos window'''.&lt;br /&gt;
&lt;br /&gt;
Then click on the '''Start''' button that is of the shape of the play button.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
We will see a '''warning message''' saying that there is '''no continuous time state'''.&lt;br /&gt;
&lt;br /&gt;
This can be ignored in this example. So click on '''OK.'''&lt;br /&gt;
|-&lt;br /&gt;
| '''Show graphic window'''&lt;br /&gt;
| Now, we can see that the '''slope''' of the output '''RAMP signal''' changes to '''a''' in the graphic window.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
Next we will see how to define variables&lt;br /&gt;
&lt;br /&gt;
using the '''context menu''' in the '''Xcos toolbar.'''&lt;br /&gt;
|-&lt;br /&gt;
| Show '''workspace window'''&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;blockquote&amp;gt;First we will have to clear the previous value of '''a'''. For this :&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Go to the '''scilab console window'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Type in '''‘clear a’''' in the '''console''' and press '''enter''' .&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Now type '''‘a’''' and press Enter&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;We can see that the '''console''' shows ‘'''a’''' as undefined.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show '''Xcos window''' and '''context menu'''&lt;br /&gt;
&lt;br /&gt;
'''a=1'''&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Next, in the menu bar of the '''Untitled-Xcos window,''' click on '''Simulation'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;In the drop down menu select the '''set context''' option.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''set context''' popup window appears.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Type a=1 in the window and click ok.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Show '''Xcos window'''&lt;br /&gt;
|&lt;br /&gt;
Now we execute the simulation again''':'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Go to the '''toolbar''' and click '''start.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Click '''ok''' in the warning window.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Then switch to the graphic window&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;We can see that the '''slope''' of '''output RAMP''' changed to '''‘a’'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide :&lt;br /&gt;
&lt;br /&gt;
'''Advantages of Context menu'''&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Using the '''set context menu''' we can include the variables in the simulation itself.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;We need not carry an additional '''sci file''' just to initialize the variable.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Summary'''&lt;br /&gt;
|&lt;br /&gt;
This brings us to the end of this tutorial. Let us summarise.&lt;br /&gt;
&lt;br /&gt;
In this tutorial, we have learnt to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Pass variables from '''Scilab''' '''Console''' to '''Xcos.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Pass variables from '''context menu''' to '''Xcos.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show slide ;&lt;br /&gt;
&lt;br /&gt;
'''Assignment'''&lt;br /&gt;
|&lt;br /&gt;
As an assignment, please do the following&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Change the value of variable ‘a’ to 5 using the Console window and context menu.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Check the output in the graphic window.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''About Spoken Tutorial Project'''&lt;br /&gt;
|&lt;br /&gt;
The video at the following link summarises the '''Spoken Tutorial''' project.&lt;br /&gt;
&lt;br /&gt;
Please download and watch it.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Spoken Tutorial Workshops'''&lt;br /&gt;
|&lt;br /&gt;
The '''Spoken Tutorial''' Project Team conducts workshops and gives certificates.&lt;br /&gt;
&lt;br /&gt;
For more details, please write to us&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Answers for THIS Spoken Tutorial'''&lt;br /&gt;
| Please post your timed queries in this forum.&lt;br /&gt;
|-&lt;br /&gt;
| Show Slide: '''FOSSEE Forum'''&lt;br /&gt;
| Please post your general and technical queries on '''Scilab''' in this forum.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Textbook Companion project'''&lt;br /&gt;
|&lt;br /&gt;
The '''FOSSEE''' team coordinates the '''Textbook Companion project'''.&lt;br /&gt;
&lt;br /&gt;
We give '''Certificates''' and '''Honorarium''' to the contributors.&lt;br /&gt;
&lt;br /&gt;
For more details, please visit this site..&lt;br /&gt;
|-&lt;br /&gt;
| Show Slide: '''Lab Migration'''&lt;br /&gt;
|&lt;br /&gt;
The '''FOSSEE''' team coordinates the '''Lab Migration project'''.&lt;br /&gt;
&lt;br /&gt;
For more details, please visit this site.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Acknowledgement'''&lt;br /&gt;
| Spoken Tutorial and FOSSEE projects are funded by MoE, Government of India.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide :&lt;br /&gt;
&lt;br /&gt;
'''Thank you'''&lt;br /&gt;
|&lt;br /&gt;
This is Iswariya Sasikumar, a FOSSEE intern 2021, IIT Bombay signing off.&lt;br /&gt;
&lt;br /&gt;
Thanks for joining.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Iswariyas</name></author>	</entry>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php/Scilab/C4/Interactive-Simulation-in-Xcos-using-slider/English</id>
		<title>Scilab/C4/Interactive-Simulation-in-Xcos-using-slider/English</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php/Scilab/C4/Interactive-Simulation-in-Xcos-using-slider/English"/>
				<updated>2021-08-30T12:23:33Z</updated>
		
		<summary type="html">&lt;p&gt;Iswariyas: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Title of script''': Interactive Simulation in '''Xcos''' Using '''Slider'''&lt;br /&gt;
&lt;br /&gt;
'''Author: Rupak Rokade and Iswariya Sasikumar'''&lt;br /&gt;
&lt;br /&gt;
{| class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
! '''Visual Cue'''&lt;br /&gt;
! '''Narration'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Title Slide'''&lt;br /&gt;
| Hello and welcome to the Spoken Tutorial on “'''Interactive Simulation in Xcos Using Slider'''”.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Learning Objectives'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
In this tutorial, we will learn how to:&lt;br /&gt;
&lt;br /&gt;
* Use '''Slider''' in '''Xcos'''&lt;br /&gt;
* Use '''TKSCALE block''' for '''simulation''' and&lt;br /&gt;
* Run '''Xcos simulations''' in real-time&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''System Requirements'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
To record this tutorial, I am using&lt;br /&gt;
&lt;br /&gt;
* '''Windows 10 OS'''&lt;br /&gt;
* '''Scilab 6.1.0 '''&lt;br /&gt;
&lt;br /&gt;
The process demonstrated in this tutorial is identical in '''Linux''' OS also.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Pre-requisites'''&lt;br /&gt;
&lt;br /&gt;
https://www.spoken-tutorial.org&lt;br /&gt;
|&lt;br /&gt;
To follow this tutorial, you should have&lt;br /&gt;
&lt;br /&gt;
* Basic knowledge of '''Scilab''' and '''Xcos.'''&lt;br /&gt;
* If not, for relevant tutorials please visit this website.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Interactive Simulation'''&lt;br /&gt;
|&lt;br /&gt;
* '''Interactive simulation''' gives a way to change the '''parameters''' during '''simulation'''.&lt;br /&gt;
* The '''parameters''' can be changed by using the '''Slider.'''&lt;br /&gt;
* In this tutorial we will see how to change values using the '''TKSCALE block''' as a '''slider''' .&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On the '''Scilab console''',&lt;br /&gt;
&lt;br /&gt;
'''Applications&amp;amp;gt;&amp;amp;gt;Xcos'''.&lt;br /&gt;
|&lt;br /&gt;
Open the '''Scilab console'''.&lt;br /&gt;
&lt;br /&gt;
In the '''menu bar''' click on '''Applications''' and select '''Xcos.'''&lt;br /&gt;
|-&lt;br /&gt;
| Cursor on the '''Palette browser window''' and '''Untitled-Xcos window'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
Notice the '''Palette browser window''' is located on the left side.&lt;br /&gt;
&lt;br /&gt;
The '''Untitled - Xcos window''' is on the right side.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Cursor on the '''Palette browser window''',&lt;br /&gt;
&lt;br /&gt;
'''Sources&amp;amp;gt;&amp;amp;gt;TKSCALE''' .&lt;br /&gt;
|&lt;br /&gt;
In the '''Palette browser-Xcos''' window, click on '''Sources palette.'''&lt;br /&gt;
&lt;br /&gt;
In the right panel, scroll down and click on the '''TKSCALE block'''.&lt;br /&gt;
|-&lt;br /&gt;
| Cursor on '''TKSCALE''' and '''Untitled-Xcos window'''.&lt;br /&gt;
| Let us drag and drop this '''block''' in the '''Untitled-Xcos window'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On the '''Palette browser window''',&lt;br /&gt;
&lt;br /&gt;
'''Sinks&amp;amp;gt;&amp;amp;gt;CSCOPE.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
Next, go to the '''Palette browser-Xcos window'''.&lt;br /&gt;
&lt;br /&gt;
Click on the '''Sinks palette'''.&lt;br /&gt;
&lt;br /&gt;
In the right panel, scroll down and select the '''CSCOPE block'''.&lt;br /&gt;
&lt;br /&gt;
Now, drag and drop it after the '''TKSCALE block'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Untitled-Xcos window,'''&lt;br /&gt;
&lt;br /&gt;
Double-click on '''TKSCALE'''.&lt;br /&gt;
|&lt;br /&gt;
Next we will see the '''parameters''' for the '''TKSCALE block'''.&lt;br /&gt;
&lt;br /&gt;
Double-click on the '''TKSCALE block'''.&lt;br /&gt;
|-&lt;br /&gt;
| On '''Scilab Multiple Values Request''',&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
A window named '''Scilab Multiple Values Request''' appears.&lt;br /&gt;
&lt;br /&gt;
It displays the '''TKSCALE block parameters'''.&lt;br /&gt;
|-&lt;br /&gt;
|Point to the '''Min value'''.&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
Here, '''“Min value” -10''' represents the minimum value in the range of the '''slider scale.'''&lt;br /&gt;
|-&lt;br /&gt;
|Point to the '''Max value'''.&lt;br /&gt;
|'''“Max value” 10''' represents the maximum value in the range of the '''slider scale'''.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Point to the '''Normalization.'''&lt;br /&gt;
&lt;br /&gt;
Click on '''OK.'''&lt;br /&gt;
|And '''“Normalization” 1''' represents the '''interval''' value of the '''slider scale'''.&lt;br /&gt;
&lt;br /&gt;
Click on '''OK'''.&lt;br /&gt;
|-&lt;br /&gt;
|Point to the '''black input''' of '''CSCOPE.'''&lt;br /&gt;
&lt;br /&gt;
|The black '''input port''' in the '''CSCOPE''' carries the '''data''' values.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Point to the '''red input''' of '''CSCOPE.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|The red '''input port''' in the '''CSCOPE''' represents the '''events'''.&lt;br /&gt;
&lt;br /&gt;
The '''red input''' can connect only to a '''block''' that generates the '''events'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Cursor on the '''Palette browser window''',&lt;br /&gt;
&lt;br /&gt;
'''Sources&amp;amp;gt;&amp;amp;gt;CLOCK _c.'''&lt;br /&gt;
&lt;br /&gt;
As per narration.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
To generate the '''events''', go to the '''Palette browser-Xcos window'''.&lt;br /&gt;
&lt;br /&gt;
Click on the '''Sources palette'''.&lt;br /&gt;
&lt;br /&gt;
Then click on the '''CLOCK underscore c block'''.&lt;br /&gt;
&lt;br /&gt;
Drag and drop the '''CLOCK underscore c block''' above the '''CSCOPE block'''.&lt;br /&gt;
|-&lt;br /&gt;
| Hover cursor on '''Untitled-Xcos window'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
We have collected all the required '''blocks''' in the '''Untitled-Xcos window''' to do the '''simulation'''.&lt;br /&gt;
&lt;br /&gt;
Let us now connect the '''blocks''' together.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Untitled-Xcos window''',&lt;br /&gt;
&lt;br /&gt;
Connect as per narration.&lt;br /&gt;
|&lt;br /&gt;
Select the '''black output port''' of the '''TKSCALE block'''.&lt;br /&gt;
&lt;br /&gt;
Connect it to the '''black input port''' of the '''CSCOPE block'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Untitled-Xcos window''',&lt;br /&gt;
&lt;br /&gt;
Connect as per narration.&lt;br /&gt;
|&lt;br /&gt;
Next select the red '''output port''' of the '''CLOCK underscore c block'''.&lt;br /&gt;
&lt;br /&gt;
Connect it to the red '''input port''' of the '''CSCOPE block'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Untitled-Xcos window,'''&lt;br /&gt;
&lt;br /&gt;
Connect as per narration.&lt;br /&gt;
|&lt;br /&gt;
Next select the '''red input port''' of the '''TKSCALE block'''.&lt;br /&gt;
&lt;br /&gt;
Connect it to the '''line''' connecting '''CLOCK underscore c''' and '''CSCOPE block'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Untitled-Xcos window,'''&lt;br /&gt;
&lt;br /&gt;
Connect as per narration.&lt;br /&gt;
|&lt;br /&gt;
Use the left mouse click to create '''line bends''' and then connect it to the '''line'''.&lt;br /&gt;
&lt;br /&gt;
Now let us '''simulate''' this file with the default values.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Untitled-Xcos window,'''&lt;br /&gt;
&lt;br /&gt;
Click on '''start'''.&lt;br /&gt;
|&lt;br /&gt;
To start the '''simulation''', go to the '''toolbar''' of the '''Untitled-Xcos window'''.&lt;br /&gt;
&lt;br /&gt;
Then click on the '''Start''' button that is of the shape of the '''play''' button.&lt;br /&gt;
|-&lt;br /&gt;
| Cursor on the '''Slider''' and the '''Graphic window'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
Two windows get opened.&lt;br /&gt;
&lt;br /&gt;
The left window will display the '''slider'''.&lt;br /&gt;
&lt;br /&gt;
The right '''Graphic''' window will display the output of the '''system'''.&lt;br /&gt;
|-&lt;br /&gt;
| Hover cursor over '''slider'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
Notice that the '''slider''' opens and closes quickly.&lt;br /&gt;
&lt;br /&gt;
It doesn’t give a chance to make use of this '''slider'''.&lt;br /&gt;
&lt;br /&gt;
This is happening because '''Xcos''' is trying to '''simulate''' this file at computer time.&lt;br /&gt;
|-&lt;br /&gt;
| Close '''Graphic window'''&lt;br /&gt;
| To handle this problem, first close the '''Graphic''' window.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Untitled-Xcos window''',&lt;br /&gt;
&lt;br /&gt;
'''Simulation&amp;amp;gt;&amp;amp;gt;Setup'''&lt;br /&gt;
|&lt;br /&gt;
Then go to the '''menu bar''' of the '''Untitled-Xcos''' window and click on '''Simulation'''.&lt;br /&gt;
&lt;br /&gt;
Then click on '''Setup'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Set parameters window''',&lt;br /&gt;
&lt;br /&gt;
Cursor on '''Real time scaling'''&lt;br /&gt;
|&lt;br /&gt;
A pop up window named '''Set parameters''' appears.&lt;br /&gt;
&lt;br /&gt;
We will change the default value of the '''real time scaling''' to '''1.'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Hover cursor over '''Set parameters''' window.&lt;br /&gt;
&lt;br /&gt;
Click on '''OK'''.&lt;br /&gt;
|&lt;br /&gt;
Keep the other '''parameters''' unchanged.&lt;br /&gt;
&lt;br /&gt;
Then click on '''OK.'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Untitled-Xcos''' window, click on '''Start'''.&lt;br /&gt;
|&lt;br /&gt;
To start the '''simulation,''' go to the '''toolbar''' of the '''Untitled-Xcos window'''.&lt;br /&gt;
&lt;br /&gt;
Click on the '''Start button'''.&lt;br /&gt;
|-&lt;br /&gt;
| Cursor on '''Graphic window''' and '''slider'''&lt;br /&gt;
| A '''Graphic''' window and the '''slider''' will open.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Hover cursor over the '''slider'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hover cursor over '''slider''' and '''Graphic''' window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
Now I’ll change the value of a '''parameter''' using the '''slider'''.&lt;br /&gt;
&lt;br /&gt;
Notice that I am changing the value while the '''simulation''' is '''running'''.&lt;br /&gt;
&lt;br /&gt;
Observe the changes on the '''Graphic''' window as I change the '''slider''' value.&lt;br /&gt;
&lt;br /&gt;
So this is how we can make the '''Xcos simulation interactive''' using a '''slider'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
| This brings us to the end of this tutorial. Let us summarise.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Summary'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
In this tutorial, we have learnt to:&lt;br /&gt;
&lt;br /&gt;
* Use '''Slider''' in '''Xcos'''&lt;br /&gt;
* Use '''TKSCALE block''' for '''simulation''' and&lt;br /&gt;
* Run '''Xcos simulations''' in real-time&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Assignment'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
As an assignment, please do the following.&lt;br /&gt;
&lt;br /&gt;
* Modify the '''Xcos''' diagram to have an '''autoscale''' feature (scale graph at '''runtime''') in the graph.&lt;br /&gt;
* Hint: Explore the use of '''SCALE underscore CSCOPE''' to have the '''autoscale''' feature.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''About Spoken Tutorial Project'''&lt;br /&gt;
|&lt;br /&gt;
The video at the following link summarises the '''Spoken Tutorial''' project.&lt;br /&gt;
&lt;br /&gt;
Please download and watch it.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Spoken Tutorial Workshops'''&lt;br /&gt;
|&lt;br /&gt;
The '''Spoken Tutorial''' Project Team conducts workshops and gives certificates.&lt;br /&gt;
&lt;br /&gt;
For more details, please write to us.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Answers for THIS Spoken Tutorial'''&lt;br /&gt;
| Please post your timed queries in this forum.&lt;br /&gt;
|-&lt;br /&gt;
| Show Slide: '''FOSSEE Forum'''&lt;br /&gt;
| Please post your general and technical queries on '''Scilab''' in this forum.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Textbook Companion project.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
The '''FOSSEE''' team coordinates the '''Textbook Companion project'''.&lt;br /&gt;
&lt;br /&gt;
We give '''Certificates''' and '''Honorarium''' to the contributors.&lt;br /&gt;
&lt;br /&gt;
For more details, please visit this site.&lt;br /&gt;
|-&lt;br /&gt;
| Show Slide: '''Lab Migration'''&lt;br /&gt;
|&lt;br /&gt;
The '''FOSSEE''' team coordinates the '''Lab Migration project'''.&lt;br /&gt;
&lt;br /&gt;
For more details, please visit this site.&lt;br /&gt;
|-&lt;br /&gt;
| Show Slide: '''Acknowledgements'''&lt;br /&gt;
| '''Spoken Tutorial''' and '''FOSSEE''' projects are funded by '''MoE''', '''Government of India'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
This is '''Iswariya Sasikumar''', a FOSSEE intern 2021, IIT Bombay signing off.&lt;br /&gt;
&lt;br /&gt;
Thanks for joining.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Iswariyas</name></author>	</entry>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php/Scilab/C4/Interactive-Simulation-in-Xcos-using-slider/English</id>
		<title>Scilab/C4/Interactive-Simulation-in-Xcos-using-slider/English</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php/Scilab/C4/Interactive-Simulation-in-Xcos-using-slider/English"/>
				<updated>2021-08-30T12:19:09Z</updated>
		
		<summary type="html">&lt;p&gt;Iswariyas: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Title of script''': Interactive Simulation in '''Xcos''' Using '''Slider'''&lt;br /&gt;
&lt;br /&gt;
'''Author: Rupak Rokade and Iswariya Sasikumar'''&lt;br /&gt;
&lt;br /&gt;
{| class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
! '''Visual Cue'''&lt;br /&gt;
! '''Narration'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Title Slide'''&lt;br /&gt;
| Hello and welcome to the Spoken Tutorial on “'''Interactive Simulation in Xcos Using Slider'''”.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Learning Objectives'''&lt;br /&gt;
|&lt;br /&gt;
In this tutorial, we will learn how to:&lt;br /&gt;
&lt;br /&gt;
* Use '''Slider''' in '''Xcos'''&lt;br /&gt;
* Use '''TKSCALE block''' for '''simulation''' and&lt;br /&gt;
* Run '''Xcos simulations''' in real-time&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''System Requirements'''&lt;br /&gt;
|&lt;br /&gt;
To record this tutorial, I am using&lt;br /&gt;
&lt;br /&gt;
* '''Windows 10 OS'''&lt;br /&gt;
* '''Scilab 6.1.0 '''&lt;br /&gt;
&lt;br /&gt;
The process demonstrated in this tutorial is identical in '''Linux''' OS also.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Pre-requisites'''&lt;br /&gt;
&lt;br /&gt;
https://www.spoken-tutorial.org&lt;br /&gt;
|&lt;br /&gt;
To follow this tutorial, you should have&lt;br /&gt;
&lt;br /&gt;
* Basic knowledge of '''Scilab''' and '''Xcos.'''&lt;br /&gt;
* If not, for relevant tutorials please visit this website.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Interactive Simulation'''&lt;br /&gt;
|&lt;br /&gt;
* '''Interactive simulation''' gives a way to change the '''parameters''' during '''simulation'''.&lt;br /&gt;
* The '''parameters''' can be changed by using the '''Slider.'''&lt;br /&gt;
* In this tutorial we will see how to change values using the '''TKSCALE block''' as a '''slider''' .&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On the '''Scilab console''',&lt;br /&gt;
&lt;br /&gt;
'''Applications&amp;amp;gt;&amp;amp;gt;Xcos'''.&lt;br /&gt;
|&lt;br /&gt;
Open the '''Scilab console'''.&lt;br /&gt;
&lt;br /&gt;
In the '''menu bar''' click on '''Applications''' and select '''Xcos.'''&lt;br /&gt;
|-&lt;br /&gt;
| Cursor on the '''Palette browser window''' and '''Untitled-Xcos window'''.&lt;br /&gt;
|&lt;br /&gt;
Notice the '''Palette browser window''' is located on the left side.&lt;br /&gt;
&lt;br /&gt;
The '''Untitled - Xcos window''' is on the right side.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Cursor on the '''Palette browser window''',&lt;br /&gt;
&lt;br /&gt;
'''Sources&amp;amp;gt;&amp;amp;gt;TKSCALE''' .&lt;br /&gt;
|&lt;br /&gt;
In the '''Palette browser-Xcos''' window, click on '''Sources palette.'''&lt;br /&gt;
&lt;br /&gt;
In the right panel, scroll down and click on the '''TKSCALE block'''.&lt;br /&gt;
|-&lt;br /&gt;
| Cursor on '''TKSCALE''' and '''Untitled-Xcos window'''.&lt;br /&gt;
| Let us drag and drop this '''block''' in the '''Untitled-Xcos window'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On the '''Palette browser window''',&lt;br /&gt;
&lt;br /&gt;
'''Sinks&amp;amp;gt;&amp;amp;gt;CSCOPE.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
Next, go to the '''Palette browser-Xcos window'''.&lt;br /&gt;
&lt;br /&gt;
Click on the '''Sinks palette'''.&lt;br /&gt;
&lt;br /&gt;
In the right panel, scroll down and select the '''CSCOPE block'''.&lt;br /&gt;
&lt;br /&gt;
Now, drag and drop it after the '''TKSCALE block'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Untitled-Xcos window,'''&lt;br /&gt;
&lt;br /&gt;
Double-click on '''TKSCALE'''.&lt;br /&gt;
|&lt;br /&gt;
Next we will see the '''parameters''' for the '''TKSCALE block'''.&lt;br /&gt;
&lt;br /&gt;
Double-click on the '''TKSCALE block'''.&lt;br /&gt;
|-&lt;br /&gt;
| On '''Scilab Multiple Values Request''',&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
A window named '''Scilab Multiple Values Request''' appears.&lt;br /&gt;
&lt;br /&gt;
It displays the '''TKSCALE block parameters'''.&lt;br /&gt;
|-&lt;br /&gt;
|Point to the '''Min value'''.&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
Here, '''“Min value” -10''' represents the minimum value in the range of the '''slider scale.'''&lt;br /&gt;
|-&lt;br /&gt;
|Point to the '''Max value'''.&lt;br /&gt;
|'''“Max value” 10''' represents the maximum value in the range of the '''slider scale'''.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Point to the '''Normalization.'''&lt;br /&gt;
&lt;br /&gt;
Click on '''OK.'''&lt;br /&gt;
|And '''“Normalization” 1''' represents the '''interval''' value of the '''slider scale'''.&lt;br /&gt;
&lt;br /&gt;
Click on '''OK'''.&lt;br /&gt;
|-&lt;br /&gt;
|Point to the '''black input''' of '''CSCOPE.'''&lt;br /&gt;
&lt;br /&gt;
|The black '''input port''' in the '''CSCOPE''' carries the '''data''' values.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Point to the '''red input''' of '''CSCOPE.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|The red '''input port''' in the '''CSCOPE''' represents the '''events'''.&lt;br /&gt;
&lt;br /&gt;
The '''red input''' can connect only to a '''block''' that generates the '''events'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Cursor on the '''Palette browser window''',&lt;br /&gt;
&lt;br /&gt;
'''Sources&amp;amp;gt;&amp;amp;gt;CLOCK _c.'''&lt;br /&gt;
&lt;br /&gt;
As per narration.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
To generate the '''events''', go to the '''Palette browser-Xcos window'''.&lt;br /&gt;
&lt;br /&gt;
Click on the '''Sources palette'''.&lt;br /&gt;
&lt;br /&gt;
Then click on the '''CLOCK underscore c block'''.&lt;br /&gt;
&lt;br /&gt;
Drag and drop the '''CLOCK underscore c block''' above the '''CSCOPE block'''.&lt;br /&gt;
|-&lt;br /&gt;
| Hover cursor on '''Untitled-Xcos window'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
We have collected all the required '''blocks''' in the '''Untitled-Xcos window''' to do the '''simulation'''.&lt;br /&gt;
&lt;br /&gt;
Let us now connect the '''blocks''' together.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Untitled-Xcos window''',&lt;br /&gt;
&lt;br /&gt;
Connect as per narration.&lt;br /&gt;
|&lt;br /&gt;
Select the '''black output port''' of the '''TKSCALE block'''.&lt;br /&gt;
&lt;br /&gt;
Connect it to the '''black input port''' of the '''CSCOPE block'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Untitled-Xcos window''',&lt;br /&gt;
&lt;br /&gt;
Connect as per narration.&lt;br /&gt;
|&lt;br /&gt;
Next select the red '''output port''' of the '''CLOCK underscore c block'''.&lt;br /&gt;
&lt;br /&gt;
Connect it to the red '''input port''' of the '''CSCOPE block'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Untitled-Xcos window,'''&lt;br /&gt;
&lt;br /&gt;
Connect as per narration.&lt;br /&gt;
|&lt;br /&gt;
Next select the '''red input port''' of the '''TKSCALE block'''.&lt;br /&gt;
&lt;br /&gt;
Connect it to the '''line''' connecting '''CLOCK underscore c''' and '''CSCOPE block'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Untitled-Xcos window,'''&lt;br /&gt;
&lt;br /&gt;
Connect as per narration.&lt;br /&gt;
|&lt;br /&gt;
Use the left mouse click to create '''line bends''' and then connect it to the '''line'''.&lt;br /&gt;
&lt;br /&gt;
Now let us '''simulate''' this file with the default values.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Untitled-Xcos window,'''&lt;br /&gt;
&lt;br /&gt;
Click on '''start'''.&lt;br /&gt;
|&lt;br /&gt;
To start the '''simulation''', go to the '''toolbar''' of the '''Untitled-Xcos window'''.&lt;br /&gt;
&lt;br /&gt;
Then click on the '''Start''' button that is of the shape of the '''play''' button.&lt;br /&gt;
|-&lt;br /&gt;
| Cursor on the '''Slider''' and the '''Graphic window'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
Two windows get opened.&lt;br /&gt;
&lt;br /&gt;
The left window will display the '''slider'''.&lt;br /&gt;
&lt;br /&gt;
The right '''Graphic''' window will display the output of the '''system'''.&lt;br /&gt;
|-&lt;br /&gt;
| Hover cursor over '''slider'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
Notice that the '''slider''' opens and closes quickly.&lt;br /&gt;
&lt;br /&gt;
It doesn’t give a chance to make use of this '''slider'''.&lt;br /&gt;
&lt;br /&gt;
This is happening because '''Xcos''' is trying to '''simulate''' this file at computer time.&lt;br /&gt;
|-&lt;br /&gt;
| Close '''Graphic window'''&lt;br /&gt;
| To handle this problem, first close the '''Graphic''' window.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Untitled-Xcos window''',&lt;br /&gt;
&lt;br /&gt;
'''Simulation&amp;amp;gt;&amp;amp;gt;Setup'''&lt;br /&gt;
|&lt;br /&gt;
Then go to the '''menu bar''' of the '''Untitled-Xcos''' window and click on '''Simulation'''.&lt;br /&gt;
&lt;br /&gt;
Then click on '''Setup'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Set parameters window''',&lt;br /&gt;
&lt;br /&gt;
Cursor on '''Real time scaling'''&lt;br /&gt;
|&lt;br /&gt;
A pop up window named '''Set parameters''' appears.&lt;br /&gt;
&lt;br /&gt;
We will change the default value of the '''real time scaling''' to '''1.'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Hover cursor over '''Set parameters''' window.&lt;br /&gt;
&lt;br /&gt;
Click on '''OK'''.&lt;br /&gt;
|&lt;br /&gt;
Keep the other '''parameters''' unchanged.&lt;br /&gt;
&lt;br /&gt;
Then click on '''OK.'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Untitled-Xcos''' window, click on '''Start'''.&lt;br /&gt;
|&lt;br /&gt;
To start the '''simulation,''' go to the '''toolbar''' of the '''Untitled-Xcos window'''.&lt;br /&gt;
&lt;br /&gt;
Click on the '''Start button'''.&lt;br /&gt;
|-&lt;br /&gt;
| Cursor on '''Graphic window''' and '''slider'''&lt;br /&gt;
| A '''Graphic''' window and the '''slider''' will open.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Hover cursor over the '''slider'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hover cursor over '''slider''' and '''Graphic''' window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
Now I’ll change the value of a '''parameter''' using the '''slider'''.&lt;br /&gt;
&lt;br /&gt;
Notice that I am changing the value while the '''simulation''' is '''running'''.&lt;br /&gt;
&lt;br /&gt;
Observe the changes on the '''Graphic''' window as I change the '''slider''' value.&lt;br /&gt;
&lt;br /&gt;
So this is how we can make the '''Xcos simulation interactive''' using a '''slider'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
| This brings us to the end of this tutorial. Let us summarise.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Summary'''&lt;br /&gt;
|&lt;br /&gt;
In this tutorial, we have learnt to:&lt;br /&gt;
&lt;br /&gt;
* Use '''Slider''' in '''Xcos'''&lt;br /&gt;
* Use '''TKSCALE block''' for '''simulation''' and&lt;br /&gt;
* Run '''Xcos simulations''' in real-time&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Assignment'''&lt;br /&gt;
|&lt;br /&gt;
As an assignment, please do the following.&lt;br /&gt;
&lt;br /&gt;
* Modify the '''Xcos''' diagram to have an '''autoscale''' feature (scale graph at '''runtime''') in the graph.&lt;br /&gt;
* Hint: Explore the use of '''SCALE underscore CSCOPE''' to have the '''autoscale''' feature.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''About Spoken Tutorial Project'''&lt;br /&gt;
|&lt;br /&gt;
The video at the following link summarises the '''Spoken Tutorial''' project.&lt;br /&gt;
&lt;br /&gt;
Please download and watch it.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Spoken Tutorial Workshops'''&lt;br /&gt;
|&lt;br /&gt;
The '''Spoken Tutorial''' Project Team conducts workshops and gives certificates.&lt;br /&gt;
&lt;br /&gt;
For more details, please write to us.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Answers for THIS Spoken Tutorial'''&lt;br /&gt;
| Please post your timed queries in this forum.&lt;br /&gt;
|-&lt;br /&gt;
| Show Slide: '''FOSSEE Forum'''&lt;br /&gt;
| Please post your general and technical queries on '''Scilab''' in this forum.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Textbook Companion project.'''&lt;br /&gt;
|&lt;br /&gt;
The '''FOSSEE''' team coordinates the '''Textbook Companion project'''.&lt;br /&gt;
&lt;br /&gt;
We give '''Certificates''' and '''Honorarium''' to the contributors.&lt;br /&gt;
&lt;br /&gt;
For more details, please visit this site.&lt;br /&gt;
|-&lt;br /&gt;
| Show Slide: '''Lab Migration'''&lt;br /&gt;
|&lt;br /&gt;
The '''FOSSEE''' team coordinates the '''Lab Migration project'''.&lt;br /&gt;
&lt;br /&gt;
For more details, please visit this site.&lt;br /&gt;
|-&lt;br /&gt;
| Show Slide: '''Acknowledgements'''&lt;br /&gt;
| '''Spoken Tutorial''' and '''FOSSEE''' projects are funded by '''MoE''', '''Government of India'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
This is '''Iswariya Sasikumar''', a FOSSEE intern 2021, IIT Bombay signing off.&lt;br /&gt;
&lt;br /&gt;
Thanks for joining.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Iswariyas</name></author>	</entry>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php/Scilab/C4/User-defined-variables-in-Xcos/English</id>
		<title>Scilab/C4/User-defined-variables-in-Xcos/English</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php/Scilab/C4/User-defined-variables-in-Xcos/English"/>
				<updated>2021-08-07T06:22:56Z</updated>
		
		<summary type="html">&lt;p&gt;Iswariyas: Created page with &amp;quot;'''Title of script: User-defined variables in Xcos'''  '''Author:Rupak Rokade and Anandajith TS'''  {| class= &amp;quot;wikitable&amp;quot; ! '''Visual Cue''' ! '''Narration''' |- | Show Slide:...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Title of script: User-defined variables in Xcos'''&lt;br /&gt;
&lt;br /&gt;
'''Author:Rupak Rokade and Anandajith TS'''&lt;br /&gt;
&lt;br /&gt;
{| class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
! '''Visual Cue'''&lt;br /&gt;
! '''Narration'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Title Slide'''&lt;br /&gt;
| Hello and welcome to the Spoken Tutorial on “ '''User-defined Variables in Xcos'''”&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Learning Objectives'''&lt;br /&gt;
|&lt;br /&gt;
In this tutorial, we will learn how to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Pass '''variables''' from '''Scilab Console''' to '''Xcos.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Pass '''variables''' from '''context menu''' to '''Xcos.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''System Requirements'''&lt;br /&gt;
|&lt;br /&gt;
To record this tutorial, I am using&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''Windows 10 OS'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''Scilab 6.1.0'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The process demonstrated in this&lt;br /&gt;
&lt;br /&gt;
tutorial is identical in '''Linux''' OS also&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Prerequisite'''&lt;br /&gt;
&lt;br /&gt;
https://www.spoken-tutorial.org&lt;br /&gt;
|&lt;br /&gt;
Before practising this tutorial, a learner should have :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Basic knowledge of '''Scilab and Xcos.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If not, then go through the '''Scilab''' spoken tutorials on this website.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Variables'''&lt;br /&gt;
|&lt;br /&gt;
There are two ways to define '''variables''' in '''Xcos''':&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Defining variables from the '''Scilab Console.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Defining variables from the context '''menu.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
| First we will create a simple '''simulation.'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show slide&lt;br /&gt;
&lt;br /&gt;
Simulation - Blocks used&lt;br /&gt;
|&lt;br /&gt;
For this we used the below blocks&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''RAMP'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''CLOCK underscore c''' and&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''CSCOPE'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Show '''Scilab workspace window'''&lt;br /&gt;
|&lt;br /&gt;
Open '''Scilab.'''&lt;br /&gt;
&lt;br /&gt;
Type in '''‘xcos'''’ in the '''Scilab console''' and press '''enter.'''&lt;br /&gt;
&lt;br /&gt;
Two windows will open :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''Palette browser''' and the&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''Untitled-Xcos window.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show '''Xcos window'''&lt;br /&gt;
&lt;br /&gt;
'''Sources palette&amp;amp;gt;&amp;amp;gt;RAMP block'''&lt;br /&gt;
|&lt;br /&gt;
To create the '''simulation''' we will have to import the necessary '''blocks.'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;In the '''Palette browser-Xcos''' window, click on '''Sources''' palette.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;In the right panel, select the '''RAMP''' block.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Now, drag and drop this block in the '''Untitled-Xcos''' window.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| '''Sinks palette&amp;amp;gt;&amp;amp;gt;CSCOPE block'''&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Go to the '''Palette browser-Xcos window'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Click on the '''sinks palette'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;In the right panel, scroll down and select the '''CSCOPE''' block.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Drag and drop it next to the '''RAMP''' block in the '''Untitled-Xcos window'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| '''Event handling&amp;amp;gt;&amp;amp;gt;Clock_c block'''&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Again go to the '''event handling palette''', select the '''CLOCK underscore c block.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Then drag and drop it above the '''CSCOPE block''' in the '''untitled -Xcos window'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Show '''Xcos window'''&lt;br /&gt;
|&lt;br /&gt;
Next we will interconnect all the '''blocks.'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Connect black '''output''' port of '''RAMP''' to black '''input''' port of '''CSCOPE.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Connect the red '''output''' port of '''CLOCK underscore c''' to the red '''input''' port of '''CSCOPE'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Our simulation is ready.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Show '''Xcos window'''&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Then right click on the RAMP '''block''' and select the block '''parameters.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Here we set the '''slope parameter''' to '''‘a’''' and click '''OK''' .&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;It shows an error as '''‘a’''' is not defined.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;This is correct because we never defined the '''variable ‘a’''' before.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| '''Show Scilab workspace window'''&lt;br /&gt;
|&lt;br /&gt;
Our first way to define a '''variable''' is using the '''Scilab console.'''&lt;br /&gt;
&lt;br /&gt;
For this, go to the '''Scilab console''' .&lt;br /&gt;
&lt;br /&gt;
Type '''‘a=1’''' and press '''enter'''&lt;br /&gt;
|-&lt;br /&gt;
| '''Show Xcos window'''&lt;br /&gt;
|&lt;br /&gt;
Now come back to the '''Untitled-Xcos window''' .&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Right click on the '''RAMP block''' and select the '''block parameter''' option in the menu.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Again we set the '''slope parameter''' to '''‘a’''' and click '''ok.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
To start the '''simulation''', go to the toolbar of the '''Untitled-Xcos window'''.&lt;br /&gt;
&lt;br /&gt;
Then click on the '''Start''' button that is of the shape of the play button.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
We will see a '''warning message''' saying that there is '''no continuous time state'''.&lt;br /&gt;
&lt;br /&gt;
This can be ignored in this example. So click on '''OK.'''&lt;br /&gt;
|-&lt;br /&gt;
| '''Show graphic window'''&lt;br /&gt;
| Now, we can see that the '''slope''' of the output '''RAMP signal''' changes to '''a''' in the graphic window.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
Next we will see how to define variables&lt;br /&gt;
&lt;br /&gt;
using the '''context menu''' in the '''Xcos toolbar.'''&lt;br /&gt;
|-&lt;br /&gt;
| Show '''workspace window'''&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;blockquote&amp;gt;First we will have to clear the previous value of '''a'''. For this :&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Go to the '''scilab console window'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Type in '''‘clear a’''' in the '''console''' and press '''enter''' .&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Now type '''‘a’''' and press Enter&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;We can see that the '''console''' shows ‘'''a’''' as undefined.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show '''Xcos window''' and '''context menu'''&lt;br /&gt;
&lt;br /&gt;
'''a=1'''&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Next, in the menu bar of the '''Untitled-Xcos window,''' click on '''Simulation'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;In the drop down menu select the '''set context''' option.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''set context''' popup window appears.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Type a=1 in the window and click ok.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Show '''Xcos window'''&lt;br /&gt;
|&lt;br /&gt;
Now we execute the simulation again''':'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Go to the '''toolbar''' and click '''start.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Click '''ok''' in the warning window.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Then switch to the graphic window&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;We can see that the '''slope''' of '''output RAMP''' changed to '''‘a’'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide :&lt;br /&gt;
&lt;br /&gt;
'''Advantages of Context menu'''&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Using the '''set context menu''' we can include the variables in the simulation itself.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;We need not carry an additional '''sci file''' just to initialize the variable.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Summary'''&lt;br /&gt;
|&lt;br /&gt;
This brings us to the end of this tutorial. Let us summarise.&lt;br /&gt;
&lt;br /&gt;
In this tutorial, we have learnt to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Pass variables from '''Scilab''' '''Console''' to '''Xcos.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Pass variables from '''context menu''' to '''Xcos.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show slide ;&lt;br /&gt;
&lt;br /&gt;
'''Assignment'''&lt;br /&gt;
|&lt;br /&gt;
As an assignment, please do the following&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Change the value of variable ‘a’ to 5 using the Console window and context menu.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Check the output in the graphic window.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''About Spoken Tutorial Project'''&lt;br /&gt;
|&lt;br /&gt;
The video at the following link summarises the '''Spoken Tutorial''' project.&lt;br /&gt;
&lt;br /&gt;
Please download and watch it.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Spoken Tutorial Workshops'''&lt;br /&gt;
|&lt;br /&gt;
The '''Spoken Tutorial''' Project Team conducts workshops and gives certificates.&lt;br /&gt;
&lt;br /&gt;
For more details, please write to us&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Answers for THIS Spoken Tutorial'''&lt;br /&gt;
| Please post your timed queries in this forum.&lt;br /&gt;
|-&lt;br /&gt;
| Show Slide: '''FOSSEE Forum'''&lt;br /&gt;
| Please post your general and technical queries on '''Scilab''' in this forum.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Textbook Companion project'''&lt;br /&gt;
|&lt;br /&gt;
The '''FOSSEE''' team coordinates the '''Textbook Companion project'''.&lt;br /&gt;
&lt;br /&gt;
We give '''Certificates''' and '''Honorarium''' to the contributors.&lt;br /&gt;
&lt;br /&gt;
For more details, please visit this site..&lt;br /&gt;
|-&lt;br /&gt;
| Show Slide: '''Lab Migration'''&lt;br /&gt;
|&lt;br /&gt;
The '''FOSSEE''' team coordinates the '''Lab Migration project'''.&lt;br /&gt;
&lt;br /&gt;
For more details, please visit this site.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Acknowledgement'''&lt;br /&gt;
| Spoken Tutorial and FOSSEE projects are funded by MoE, Government of India.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide :&lt;br /&gt;
&lt;br /&gt;
'''Thank you'''&lt;br /&gt;
|&lt;br /&gt;
This is Iswariya Sasikumar from FOSSEE intern 2021, IIT Bombay signing off.&lt;br /&gt;
&lt;br /&gt;
Thanks for joining.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Iswariyas</name></author>	</entry>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php/GUI-in-Scilab/C2/Creating-a-GUI-based-Interest-calculator/English</id>
		<title>GUI-in-Scilab/C2/Creating-a-GUI-based-Interest-calculator/English</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php/GUI-in-Scilab/C2/Creating-a-GUI-based-Interest-calculator/English"/>
				<updated>2021-08-06T18:13:45Z</updated>
		
		<summary type="html">&lt;p&gt;Iswariyas: Created page with &amp;quot;'''Title of script''': Creating a '''GUI''' based '''Interest''' calculator  '''Author: Rashmi Patankar and Iswariya Sasikumar'''   {| class= &amp;quot;wikitable&amp;quot; ! '''Visual Cue''' !...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Title of script''': Creating a '''GUI''' based '''Interest''' calculator&lt;br /&gt;
&lt;br /&gt;
'''Author: Rashmi Patankar and Iswariya Sasikumar'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
! '''Visual Cue'''&lt;br /&gt;
! '''Narration'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Title Slide'''&lt;br /&gt;
|&lt;br /&gt;
Hello and welcome to the Spoken Tutorial on&lt;br /&gt;
&lt;br /&gt;
“'''Creating a GUI based Interest calculator”.'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Learning Objectives'''&lt;br /&gt;
|&lt;br /&gt;
In this tutorial, we will:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Learn about '''Radiobuttons''' and&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Calculate simple and compound interest using '''GUI.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''System Requirements'''&lt;br /&gt;
&lt;br /&gt;
'''Only Narration'''&lt;br /&gt;
|&lt;br /&gt;
To record this tutorial, I am using&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''Windows 10 OS'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''Scilab 6.1.0 and'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''GUI Builder Toolbox 4.2.1'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The process demonstrated in this tutorial is identical in '''Linux OS''' also.&lt;br /&gt;
&lt;br /&gt;
Annotations are added to the tutorial if there are any differences.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Pre-requisites'''&lt;br /&gt;
&lt;br /&gt;
https://spoken-tutorial.org&lt;br /&gt;
|&lt;br /&gt;
To follow this tutorial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;The learner must have basic knowledge of '''Scilab''' and '''GUI Builder toolbox.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;For pre-requisite '''Scilab''' tutorials please visit this website.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Code Files'''&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;The files used in this tutorial are provided in the '''Code files''' link.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Please download and extract the files.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Make a copy and then use them while practising.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| What is a '''Radiobutton'''?&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;A '''Radiobutton''' is a button with two states.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;They are intended to be mutually exclusive.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;As a result, at any given time only one '''button''' is in a selected state.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
Objects to calculate '''simple''' and '''compound interest'''&lt;br /&gt;
|&lt;br /&gt;
To calculate the '''interest''', we need three '''Edit boxes''' to take user inputs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;The first '''Edit box''' for principal amount.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;The second '''Edit box''' for rate of interest.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;The third '''Edit box''' for time.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After that, we need two '''Radiobuttons''' to calculate Simple and Compound interest.&lt;br /&gt;
&lt;br /&gt;
Lastly, one '''Text''' box is required to display the answer.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Cursor on '''GUIBuilder''' Palette,&lt;br /&gt;
&lt;br /&gt;
Video-editor: Please put a textbox on screen. “guiFigure.sce”.&lt;br /&gt;
&lt;br /&gt;
Hover over '''GUIBuilder''' Palette and '''Graphic window number 1.'''&lt;br /&gt;
&lt;br /&gt;
Hover over three '''Edit''' boxes and one '''Text''' box&lt;br /&gt;
|&lt;br /&gt;
I have already opened the '''guiFigure.sce''' file using the '''GUIBuilder toolbox'''.&lt;br /&gt;
&lt;br /&gt;
The '''GUIBuilder Palette''' and '''Graphic window number 1''' open up.&lt;br /&gt;
&lt;br /&gt;
The graphic window shows the '''GUI''' with three '''Edit''' boxes and one '''Text''' box.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Cursor on '''GUIBuilder Palette,'''&lt;br /&gt;
&lt;br /&gt;
hover over the first '''Edit''' box.&lt;br /&gt;
&lt;br /&gt;
Video-editor: Please put a textbox on screen. “String: Enter principal amount, Tag: ed_principal”&lt;br /&gt;
| The first '''Edit''' box has the '''String''' ‘'''Enter principal amount’''' with '''Tag ‘ed_principal’.'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Cursor on '''GUIBuilder''' Palette,&lt;br /&gt;
&lt;br /&gt;
hover over the second '''Edit''' box.&lt;br /&gt;
&lt;br /&gt;
Video-editor: Please put a textbox on screen. “String: Enter rate of interest, Tag: ed_rate”&lt;br /&gt;
| The second '''Edit''' box has the '''String ‘Enter rate of interest’''' with '''Tag ‘ed_rate’.'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Cursor on '''GUIBuilder''' Palette,&lt;br /&gt;
&lt;br /&gt;
hover over the third '''Edit''' box. Video-editor: Please put a textbox on screen. “String: Enter time, Tag: ed_time”&lt;br /&gt;
| The third '''Edit''' box has the '''String ‘Enter time’''' with '''Tag ‘ed_time’.'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Cursor on '''GUIBuilder''' Palette,&lt;br /&gt;
&lt;br /&gt;
hover over the '''Text''' box.&lt;br /&gt;
&lt;br /&gt;
Video-editor: Please put a textbox on screen. “String: UnName4, Tag: txt_answer”&lt;br /&gt;
| The '''Text''' box has the '''String ‘UnName4’''' with '''Tag ‘txt_answer’'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
| Now l will add two '''Radiobuttons''' for '''Simple interest''' and '''Compound interest'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUIBuilder Palette''',&lt;br /&gt;
&lt;br /&gt;
click '''Radiobutton.'''&lt;br /&gt;
| Go to '''GUIBuilder Palette''' and click on '''Radiobutton'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Scilab Multiple Values Request''' window,&lt;br /&gt;
&lt;br /&gt;
type '''rd_simple''' and type '''Simple interest.'''&lt;br /&gt;
&lt;br /&gt;
Click on '''OK.'''&lt;br /&gt;
|&lt;br /&gt;
Let us type '''rd_simple''' as the '''Tag''' and '''Simple interest''' as the '''String'''.&lt;br /&gt;
&lt;br /&gt;
Then click on '''OK'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 1,'''&lt;br /&gt;
&lt;br /&gt;
place '''Radiobutton''' in the middle left.&lt;br /&gt;
&lt;br /&gt;
Hover cursor over '''Simple''' '''interest''' '''Radiobutton'''.&lt;br /&gt;
|&lt;br /&gt;
Let us place this '''Radiobutton''' in the middle left of '''Graphic window number 1'''.&lt;br /&gt;
&lt;br /&gt;
'''‘Simple interest’ Radio button''' appears.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUIBuilder Palette''',&lt;br /&gt;
&lt;br /&gt;
click '''Radiobutton.'''&lt;br /&gt;
| Let us take another '''Radiobutton''' for the '''Compound interest'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Scilab Multiple Values Request''' window,&lt;br /&gt;
&lt;br /&gt;
type '''rd_compound''' and type '''Compound interest.'''&lt;br /&gt;
&lt;br /&gt;
Click on '''OK.'''&lt;br /&gt;
|&lt;br /&gt;
Now I will type '''rd_compound''' as the '''Tag''' and ‘'''Compound interest’''' as the '''String'''.&lt;br /&gt;
&lt;br /&gt;
Then click on '''OK'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 1,'''&lt;br /&gt;
&lt;br /&gt;
place '''Radiobutton''' in the middle right.&lt;br /&gt;
&lt;br /&gt;
Hover cursor over '''Radiobutton'''&lt;br /&gt;
|&lt;br /&gt;
Place this '''Radiobutton''' next to the '''Simple interest Radiobutton'''.&lt;br /&gt;
&lt;br /&gt;
‘'''Compound interest’ Radiobutton''' appears.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
| Now the '''GUI''' part is completed.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUIBuilder Palette''' window,&lt;br /&gt;
&lt;br /&gt;
'''Generate&amp;amp;gt;&amp;amp;gt;Generate GUI code.'''&lt;br /&gt;
|&lt;br /&gt;
Let us save the file.&lt;br /&gt;
&lt;br /&gt;
Go to the '''GUIBuilder Palette'''.&lt;br /&gt;
&lt;br /&gt;
Click on '''Generate''' and then on the '''Generate GUI code'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Save as '''interest-calculator'''.&lt;br /&gt;
&lt;br /&gt;
Click on '''Save.'''&lt;br /&gt;
&lt;br /&gt;
Video-editor: Pls put a textbox on screen. “In Ubuntu Linux OS, click on Ok button.”&lt;br /&gt;
|&lt;br /&gt;
I will save this file as '''interest-calculator.'''&lt;br /&gt;
&lt;br /&gt;
Click on '''Save'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUI created window,'''&lt;br /&gt;
&lt;br /&gt;
click on '''OK.'''&lt;br /&gt;
|&lt;br /&gt;
A pop up opens with a message “'''GUI created successfully'''.”&lt;br /&gt;
&lt;br /&gt;
Click on '''OK'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''SciNotes''' window,&lt;br /&gt;
&lt;br /&gt;
highlight '''handles''' for '''principal, rate, time, simple interest, compound interest''' and '''answer'''.&lt;br /&gt;
|&lt;br /&gt;
You can see that the corresponding '''Scilab code''' has been generated.&lt;br /&gt;
&lt;br /&gt;
Notice the '''handles''' and '''properties''' of the objects we took on a '''graphic window'''.&lt;br /&gt;
|-&lt;br /&gt;
| Highlight '''handles.ed_principal'''.&lt;br /&gt;
| '''handles.ed_principal''' is the '''handle''' for principal amount.&lt;br /&gt;
|-&lt;br /&gt;
| Highlight '''handles.ed_rate'''.&lt;br /&gt;
| '''handles.ed_rate''' is the '''handle''' for rate.&lt;br /&gt;
|-&lt;br /&gt;
| Highlight '''handles.ed_time'''.&lt;br /&gt;
| '''handles.ed_time''' is the '''handle''' for time.&lt;br /&gt;
|-&lt;br /&gt;
| Highlight '''handles.txt_answer'''.&lt;br /&gt;
| '''handles.txt_answer''' is the '''handle''' for answer'''.'''&lt;br /&gt;
|-&lt;br /&gt;
| Highlight '''handles.rd_simple'''.&lt;br /&gt;
| '''handles.rd_simple''' is the '''handle''' for simple interest.&lt;br /&gt;
|-&lt;br /&gt;
| Highlight '''handles.rd_compound'''.&lt;br /&gt;
| '''handles.rd_compound''' is the '''handle''' for compound interest.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Hover cursor over '''rd_simple_callback'''&lt;br /&gt;
&lt;br /&gt;
function.&lt;br /&gt;
| Now let us write a '''function definition''' for '''rd_simple_callback function'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Cursor on '''SciNotes''' window,&lt;br /&gt;
&lt;br /&gt;
type within '''rd_simple_callback'''.&lt;br /&gt;
&lt;br /&gt;
'''handles.rd_simple.value = 1'''&lt;br /&gt;
&lt;br /&gt;
'''handles.rd_compound.value = 0'''&lt;br /&gt;
&lt;br /&gt;
'''Principal = strtod(handles.ed_principal.string)'''&lt;br /&gt;
&lt;br /&gt;
'''Rate = strtod(handles.ed_rate.string)'''&lt;br /&gt;
&lt;br /&gt;
'''Time = strtod(handles.ed_time.string)'''&lt;br /&gt;
&lt;br /&gt;
'''SI = (Principal * Rate * Time)/100'''&lt;br /&gt;
&lt;br /&gt;
'''handles.txt_answer.string = string(SI)'''&lt;br /&gt;
|&lt;br /&gt;
Enter the code as seen here with the same '''syntax'''.&lt;br /&gt;
&lt;br /&gt;
The same code can be found under the code files section.&lt;br /&gt;
&lt;br /&gt;
You can use it as explained earlier in this tutorial.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''handles.rd_simple.value = 1'''&lt;br /&gt;
&lt;br /&gt;
'''handles.rd_compound.value = 0'''&lt;br /&gt;
|&lt;br /&gt;
After clicking the '''Simple interest Radiobutton-'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;This line will select the '''Simple interest Radiobutton'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;The following line will deselect the '''Compound interest''' '''Radiobutton'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This way only one '''button''' remains selected.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''Principal = strtod(handles.ed_principal.string)'''&lt;br /&gt;
| Next line then assigns the user input for principal value to variable '''‘Principal’'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''Rate = strtod(handles.ed_rate.string)'''&lt;br /&gt;
| Its next line assigns the user input for rate of interest to variable '''‘Rate’'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''Time = strtod(handles.ed_time.string)'''&lt;br /&gt;
| The further line assigns the user input for time to the variable '''‘Time’'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''SI = (Principal * Rate * Time)/100'''&lt;br /&gt;
|&lt;br /&gt;
Notice the next line.&lt;br /&gt;
&lt;br /&gt;
This equation will perform the calculations.&lt;br /&gt;
&lt;br /&gt;
The final result will be stored in the variable '''‘SI''''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''handles.txt_answer.string = string(SI)'''&lt;br /&gt;
| The last line will give the value of the variable '''‘SI’''' to the '''Text''' box.&lt;br /&gt;
|-&lt;br /&gt;
| Hover cursor over '''rd_compound_callback''' function.&lt;br /&gt;
| Next I will write a function definition for '''rd_compound_callback''' function'''.'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Cursor on '''SciNotes''' window,&lt;br /&gt;
&lt;br /&gt;
type within '''rd_compound_callback'''.&lt;br /&gt;
&lt;br /&gt;
'''handles.rd_compound.value = 1'''&lt;br /&gt;
&lt;br /&gt;
'''handles.rd_simple.value = 0'''&lt;br /&gt;
&lt;br /&gt;
'''Principal = strtod(handles.ed_principal.string)'''&lt;br /&gt;
&lt;br /&gt;
'''Rate = strtod(handles.ed_rate.string)'''&lt;br /&gt;
&lt;br /&gt;
'''Time = strtod(handles.ed_time.string)'''&lt;br /&gt;
&lt;br /&gt;
'''CI = (Principal *(1+( Rate/100))^ Time) - Principal'''&lt;br /&gt;
&lt;br /&gt;
'''handles.txt_answer.string = string(CI)'''&lt;br /&gt;
|&lt;br /&gt;
Enter the code as seen here with the same '''syntax'''.&lt;br /&gt;
&lt;br /&gt;
The same code can be found under the '''Code files''' section.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''handles.rd_compound.value = 1'''&lt;br /&gt;
&lt;br /&gt;
'''handles.rd_simple.value = 0'''&lt;br /&gt;
|&lt;br /&gt;
This action is similar to what we have seen earlier.&lt;br /&gt;
&lt;br /&gt;
After clicking the '''Compound interest''' '''Radiobutton-'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;The first line will now select the '''Compound interest''' '''Radiobutton'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;The next line will deselect the '''Simple interest Radiobutton'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''Principal = strtod(handles.ed_principal.string)Rate = strtod(handles.ed_rate.string)'''&lt;br /&gt;
&lt;br /&gt;
'''Time = strtod(handles.ed_time.string)'''&lt;br /&gt;
| Notice the next three lines are the same as in the '''rd_simple_callback function.'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''CI = (Principal *(1+( Rate/100))^ Time) - Principal'''&lt;br /&gt;
|&lt;br /&gt;
The next line will calculate the '''Compound interest'''.&lt;br /&gt;
&lt;br /&gt;
The final result will be stored in '''variable ‘CI'.'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''handles.txt_answer.string = string(CI)'''&lt;br /&gt;
| The last line will give the value of '''variable ‘CI’''' to the '''Text''' box.&lt;br /&gt;
|-&lt;br /&gt;
| Press '''Ctrl+S.'''&lt;br /&gt;
| Let us save the '''Scilab code''' by pressing '''Ctrl''' and '''S''' keys together.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Scinotes''' window,&lt;br /&gt;
&lt;br /&gt;
'''Execute'''&amp;amp;gt;&amp;amp;gt;'''file''' '''with echo'''&lt;br /&gt;
|&lt;br /&gt;
Execute this by clicking '''Execute''' on the '''menubar''' and then on '''File with echo'''.&lt;br /&gt;
&lt;br /&gt;
'''Graphic window number 2''' opens.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 2,'''&lt;br /&gt;
&lt;br /&gt;
delete '''Enter the principal amount here. '''&lt;br /&gt;
&lt;br /&gt;
Type '''8000.'''&lt;br /&gt;
&lt;br /&gt;
Delete '''Enter rate of interest.'''&lt;br /&gt;
&lt;br /&gt;
Type '''7'''.&lt;br /&gt;
&lt;br /&gt;
Delete '''Enter time.'''&lt;br /&gt;
&lt;br /&gt;
Type '''3'''.&lt;br /&gt;
|&lt;br /&gt;
Now let us test the '''GUI.'''&lt;br /&gt;
&lt;br /&gt;
Delete the '''string “Enter principal amount”''' from the '''Edit''' box and type '''8000'''.&lt;br /&gt;
&lt;br /&gt;
Delete the '''string “Enter rate of interest”''' from the '''Edit''' box and type '''7'''.&lt;br /&gt;
&lt;br /&gt;
Delete the '''string “Enter time”''' from the '''Edit''' box and type '''3'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 1,'''&lt;br /&gt;
&lt;br /&gt;
click on '''Simple interest radiobutton'''.&lt;br /&gt;
&lt;br /&gt;
Hover cursor over '''Text''' box.&lt;br /&gt;
|&lt;br /&gt;
Then click on the '''Simple''' '''interest''' '''Radiobutton.'''&lt;br /&gt;
&lt;br /&gt;
The '''Text''' box shows the desired answer of '''1680''' as expected.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 1,'''&lt;br /&gt;
&lt;br /&gt;
click on '''Compound interest radiobutton'''.&lt;br /&gt;
&lt;br /&gt;
Hover cursor over '''Text''' box.&lt;br /&gt;
|&lt;br /&gt;
Next click on the '''Compound''' '''interest''' '''Radiobutton.'''&lt;br /&gt;
&lt;br /&gt;
Now the '''Text''' box shows the desired answer of '''1800.344''' as expected.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Summary'''&lt;br /&gt;
|&lt;br /&gt;
This brings us to the end of this tutorial.  Let us summarise.&lt;br /&gt;
&lt;br /&gt;
In this tutorial, we have:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Learnt about '''Radiobuttons''' and&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Calculated simple and compound interest using '''GUI.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Assignment'''&lt;br /&gt;
|&lt;br /&gt;
As an assignment, please do the following.&lt;br /&gt;
&lt;br /&gt;
Create a '''GUI''' which has&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;An '''Edit''' box to take user input in meters.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Two '''Radiobuttons''' to convert it into inches and feet.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;One '''Text''' box to display the output.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''About Spoken Tutorial Project'''&lt;br /&gt;
|&lt;br /&gt;
The video at the following link summarises the '''Spoken Tutorial''' project.&lt;br /&gt;
&lt;br /&gt;
Please download and watch it.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Spoken Tutorial Workshops'''&lt;br /&gt;
|&lt;br /&gt;
We conduct workshops using '''Spoken Tutorials''' and give certificates.&lt;br /&gt;
&lt;br /&gt;
Please contact us.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Answers for THIS Spoken Tutorial'''&lt;br /&gt;
| Please post your timed queries in this forum.&lt;br /&gt;
|-&lt;br /&gt;
| Show Slide: '''FOSSEE Forum'''&lt;br /&gt;
| Please post your general and technical queries on '''Scilab''' in this forum.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Textbook Companion project'''&lt;br /&gt;
|&lt;br /&gt;
The '''FOSSEE''' team coordinates the '''TBC''' project.&lt;br /&gt;
&lt;br /&gt;
For more details, please visit this site.&lt;br /&gt;
|-&lt;br /&gt;
| Show Slide: '''Lab Migration'''&lt;br /&gt;
|&lt;br /&gt;
The '''FOSSEE''' team coordinates the '''Lab Migration''' project.&lt;br /&gt;
&lt;br /&gt;
For more details, please visit this site.&lt;br /&gt;
|-&lt;br /&gt;
| Show Slide: '''Acknowledgement'''&lt;br /&gt;
| The '''Spoken Tutorial''' project is funded by the '''Ministry of Education, Government of India'''.&lt;br /&gt;
|-&lt;br /&gt;
| Show Slide: '''Thank you'''&lt;br /&gt;
|&lt;br /&gt;
This is '''Iswariya Sasikumar,''' a '''FOSSEE''' intern 2021, IIT Bombay signing off.&lt;br /&gt;
&lt;br /&gt;
Thanks for joining.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Iswariyas</name></author>	</entry>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php/GUI-in-Scilab/C2/Building-a-GUI-for-basic-plotting/English</id>
		<title>GUI-in-Scilab/C2/Building-a-GUI-for-basic-plotting/English</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php/GUI-in-Scilab/C2/Building-a-GUI-for-basic-plotting/English"/>
				<updated>2021-08-06T18:04:30Z</updated>
		
		<summary type="html">&lt;p&gt;Iswariyas: Created page with &amp;quot;'''Title of script''': Building a '''GUI''' for basic plotting.  '''Author: Rashmi Patankar and Iswariya Sasikumar'''  {| class= &amp;quot;wikitable&amp;quot; ! '''Visual Cue''' ! '''Narration'...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Title of script''': Building a '''GUI''' for basic plotting.&lt;br /&gt;
&lt;br /&gt;
'''Author: Rashmi Patankar and Iswariya Sasikumar'''&lt;br /&gt;
&lt;br /&gt;
{| class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
! '''Visual Cue'''&lt;br /&gt;
! '''Narration'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Title Slide'''&lt;br /&gt;
|&lt;br /&gt;
Hello and welcome to the Spoken Tutorial on&lt;br /&gt;
&lt;br /&gt;
“'''Building a GUI for basic plotting”.'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Learning Objectives'''&lt;br /&gt;
|&lt;br /&gt;
In this tutorial, we will learn:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;About '''Checkbox'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Generate graphs of the '''sine''' and '''cosine functions''' using '''GUI'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''System Requirements'''&lt;br /&gt;
&lt;br /&gt;
'''Only Narration'''&lt;br /&gt;
|&lt;br /&gt;
To record this tutorial, I am using&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''Windows 10 OS'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''Scilab 6.1.0 and'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''GUI Builder Toolbox 4.2.1'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The process demonstrated in this tutorial is identical in '''Linux OS''' also.&lt;br /&gt;
&lt;br /&gt;
Annotations are added to the tutorial if there are any differences.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Pre-requisites'''&lt;br /&gt;
&lt;br /&gt;
https://spoken-tutorial.org&lt;br /&gt;
|&lt;br /&gt;
To follow this tutorial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;The learner must have basic knowledge of '''Scilab''' and '''GUI Builder toolbox.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;For pre-requisite '''Scilab''' tutorials please visit this website.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Code Files'''&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;The files used in this tutorial are provided in the '''Code files''' link.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Please download and extract the files.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Make a copy and then use them while practising.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''What is Checkbox?'''&lt;br /&gt;
|&lt;br /&gt;
A '''Checkbox''' is a button with two states.&lt;br /&gt;
&lt;br /&gt;
It is used when a user wants to make multiple independent choices.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
Let us begin with creating the '''GUI'''.&lt;br /&gt;
&lt;br /&gt;
I have opened the '''GUIBuilder toolbox'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Cursor on '''GUIBuilder Palette''',&lt;br /&gt;
&lt;br /&gt;
click '''Checkbox.'''&lt;br /&gt;
| Go to '''GUIBuilder''' '''Palette''' and click on '''Checkbox'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Scilab Multiple Values Request''' window,&lt;br /&gt;
&lt;br /&gt;
type '''chk_sine''' as '''Tag''',&lt;br /&gt;
&lt;br /&gt;
type '''sin(t)''' as '''String.'''&lt;br /&gt;
&lt;br /&gt;
Click on '''OK.'''&lt;br /&gt;
|&lt;br /&gt;
Type '''chk_sine''' as the '''Tag''' and '''sin(t)''' as the '''String'''.&lt;br /&gt;
&lt;br /&gt;
Then click on '''OK'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 1,'''&lt;br /&gt;
&lt;br /&gt;
place the '''Checkbox''' in the window's top left side.&lt;br /&gt;
&lt;br /&gt;
Hover cursor over '''Checkbox'''.&lt;br /&gt;
|&lt;br /&gt;
Place the '''Checkbox''' in the window's top left side by considering a suitable size.&lt;br /&gt;
&lt;br /&gt;
A '''sin(t) Checkbox''' appears. &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUIBuilder Palette''',&lt;br /&gt;
&lt;br /&gt;
hover over '''cos(t) Checkbox.'''&lt;br /&gt;
&lt;br /&gt;
Video-editor: Please put a textbox on screen. “Tag: chk_cosine, String: cos(t)”&lt;br /&gt;
|&lt;br /&gt;
In the similar way, I have taken another '''Checkbox''' for the '''cosine function'''.&lt;br /&gt;
&lt;br /&gt;
I have written '''chk_cosine''' as the '''Tag''' and '''cos(t)''' as the '''String'''.&lt;br /&gt;
&lt;br /&gt;
By considering the suitable size, I have placed it below the '''sin(t) Checkbox'''.&lt;br /&gt;
&lt;br /&gt;
Pause the tutorial and do likewise in your '''GUI interface'''.&lt;br /&gt;
|-&lt;br /&gt;
| On '''GUIBuilder Palette''',&lt;br /&gt;
| To display the response of a system, we need '''Axes'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 1,'''&lt;br /&gt;
&lt;br /&gt;
hover over '''Axes'''.&lt;br /&gt;
&lt;br /&gt;
Video-editor: Please put a textbox on screen. “Tag: ax_response, String: System Response”&lt;br /&gt;
|&lt;br /&gt;
Hence I have taken an '''Axes''' with '''ax_response''' as '''Tag''' and '''System Response''' as '''String'''.&lt;br /&gt;
&lt;br /&gt;
Notice that I have placed it on the right side of the window.&lt;br /&gt;
&lt;br /&gt;
It appears like a '''box''' with a black border'''.'''&lt;br /&gt;
&lt;br /&gt;
Again, pause the tutorial and do likewise in your '''GUI interface'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
| Now the '''GUI''' part is completed. &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUIBuilder Palette''' window,&lt;br /&gt;
&lt;br /&gt;
'''Generate&amp;amp;gt;&amp;amp;gt;Generate GUI code.'''&lt;br /&gt;
|&lt;br /&gt;
Let us generate the '''Scilab code''' file for this.&lt;br /&gt;
&lt;br /&gt;
Go to the '''GUIBuilder Palette'''.&lt;br /&gt;
&lt;br /&gt;
Click on '''Generate''' and then on the '''Generate GUI code.'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Save as '''finding_wave'''.&lt;br /&gt;
&lt;br /&gt;
Click on '''Save.'''&lt;br /&gt;
&lt;br /&gt;
Video-editor: Pls put a textbox on screen. “In Ubuntu Linux OS, click on Ok button.”&lt;br /&gt;
|&lt;br /&gt;
I will save this file as '''finding_wave.'''&lt;br /&gt;
&lt;br /&gt;
Click on '''Save'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUI created window,'''&lt;br /&gt;
&lt;br /&gt;
Click on '''OK.'''&lt;br /&gt;
|&lt;br /&gt;
A pop up opens with the message “'''GUI created successfully'''.”&lt;br /&gt;
&lt;br /&gt;
Click on '''OK.'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''SciNotes''' window,&lt;br /&gt;
&lt;br /&gt;
highlight '''handles''' for '''sine''', '''cosine''' and '''axes'''.&lt;br /&gt;
|&lt;br /&gt;
You can see that the corresponding '''Scilab code''' has been generated.&lt;br /&gt;
&lt;br /&gt;
Notice the '''handles''' and '''properties''' of the objects we took on a '''graphic window'''.&lt;br /&gt;
|-&lt;br /&gt;
| Highlight '''handles.chk_sine'''.&lt;br /&gt;
| '''handles.chk_sine''' is the '''handle''' for '''sine Checkbox.'''&lt;br /&gt;
|-&lt;br /&gt;
| Highlight '''handles.chk_cosine'''.&lt;br /&gt;
| '''handles.chk_cosine''' is the '''handle''' for '''cosine Checkbox.'''&lt;br /&gt;
|-&lt;br /&gt;
| Highlight '''handles.ax_response'''.&lt;br /&gt;
| '''handles.ax_response''' is the '''handle''' for '''Axes.'''&lt;br /&gt;
|-&lt;br /&gt;
| Hover cursor over '''chk_sine_callback''' function.&lt;br /&gt;
| Now let us write a '''function definition''' within the '''chk_sine_callback function'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Cursor on '''SciNotes''' window,&lt;br /&gt;
&lt;br /&gt;
type within '''chk_sine_callback'''.&lt;br /&gt;
&lt;br /&gt;
Type,&lt;br /&gt;
&lt;br /&gt;
'''t = 0:0.1:2*%pi;'''&lt;br /&gt;
&lt;br /&gt;
'''if handles.chk_sine.Value == 1'''&lt;br /&gt;
&lt;br /&gt;
'''then plot(t,sin(t))'''&lt;br /&gt;
&lt;br /&gt;
'''else'''&lt;br /&gt;
&lt;br /&gt;
'''plot(t,sin(t),'w')'''&lt;br /&gt;
&lt;br /&gt;
'''end'''&lt;br /&gt;
|&lt;br /&gt;
Enter the code as seen here with the same '''syntax'''.&lt;br /&gt;
&lt;br /&gt;
The same code can be found under the '''Code files''' section.&lt;br /&gt;
&lt;br /&gt;
You can use it as explained earlier in this tutorial.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''t = 0:0.1:2*%pi;'''&lt;br /&gt;
| The first line defines the range of '''t''' from '''0''' to '''2 pi''' with a step size of '''0.1'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''if handles.chk_sine.Value == 1'''&lt;br /&gt;
&lt;br /&gt;
'''then plot(t,sin(t))'''&lt;br /&gt;
&lt;br /&gt;
'''else'''&lt;br /&gt;
&lt;br /&gt;
'''plot(t,sin(t),'w')'''&lt;br /&gt;
&lt;br /&gt;
'''end'''&lt;br /&gt;
|&lt;br /&gt;
Further an '''if else''' statement is defined.&lt;br /&gt;
&lt;br /&gt;
The '''checkbox''' for '''sin(t)''' is checked if the value is set to 1.&lt;br /&gt;
&lt;br /&gt;
So, if it is checked then the response of the '''sine''' wave is plotted.&lt;br /&gt;
&lt;br /&gt;
If it is unchecked, then an invisible response will be plotted with white color.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Cursor on '''SciNotes''' window,&lt;br /&gt;
&lt;br /&gt;
type within '''chk_cosine_callback'''.&lt;br /&gt;
&lt;br /&gt;
Type,&lt;br /&gt;
&lt;br /&gt;
'''t = 0:0.1:2*%pi;'''&lt;br /&gt;
&lt;br /&gt;
'''if handles.chk_cosine.Value == 1'''&lt;br /&gt;
&lt;br /&gt;
'''then plot(t,cos(t))'''&lt;br /&gt;
&lt;br /&gt;
'''else'''&lt;br /&gt;
&lt;br /&gt;
'''plot(t,cos(t),'w')'''&lt;br /&gt;
&lt;br /&gt;
'''end'''&lt;br /&gt;
|&lt;br /&gt;
Next I will write a function definition for '''chk_cosine_callback function.'''&lt;br /&gt;
&lt;br /&gt;
Enter the code as seen here with the same '''syntax''' as explained earlier.&lt;br /&gt;
&lt;br /&gt;
The same code can also be found under the '''Code files''' section.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''t = 0:0.1:2*%pi;'''&lt;br /&gt;
|&lt;br /&gt;
The first line is the same as seen in the '''chk_sine_callback function.'''&lt;br /&gt;
&lt;br /&gt;
It will define the range of '''‘t’'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''if handles.chk_cosine.Value == 1'''&lt;br /&gt;
&lt;br /&gt;
'''then plot(t,cos(t))'''&lt;br /&gt;
&lt;br /&gt;
'''else'''&lt;br /&gt;
&lt;br /&gt;
'''plot(t,cos(t),'w')'''&lt;br /&gt;
&lt;br /&gt;
'''end'''&lt;br /&gt;
|&lt;br /&gt;
Further an '''if else''' statement for '''cos(t) checkbox''' is defined.&lt;br /&gt;
&lt;br /&gt;
This action is similar to what we have seen previously.&lt;br /&gt;
&lt;br /&gt;
If the '''checkbox''' for '''cos(t)''' is checked, then it will plot the response of the '''cosine''' wave.&lt;br /&gt;
&lt;br /&gt;
If it is unchecked, then an invisible response will be plotted with white color.&lt;br /&gt;
|-&lt;br /&gt;
| Press '''Ctrl+S.'''&lt;br /&gt;
| Now let us save the '''Scilab code''' by pressing '''Ctrl''' and '''S''' keys together.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Scinotes''' window,&lt;br /&gt;
&lt;br /&gt;
'''Execute'''&amp;amp;gt;&amp;amp;gt;'''file''' '''with echo.'''&lt;br /&gt;
| To execute, click on '''Execute''' on the '''menu bar''' and then on '''file with echo'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 2,'''&lt;br /&gt;
&lt;br /&gt;
check the '''sin(t) checkbox.'''&lt;br /&gt;
&lt;br /&gt;
Hover cursor over the '''Axes'''.&lt;br /&gt;
|&lt;br /&gt;
Now check the '''sin(t) checkbox.'''&lt;br /&gt;
&lt;br /&gt;
You will see the time response of the '''sine function''' on the '''Axes'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 2,'''&lt;br /&gt;
&lt;br /&gt;
check the '''cos(t) checkbox.'''&lt;br /&gt;
&lt;br /&gt;
Hover cursor over the '''Axes'''.&lt;br /&gt;
|&lt;br /&gt;
Let us now check the '''cos(t)''' '''checkbox'''.&lt;br /&gt;
&lt;br /&gt;
'''Axes''' shows the time response of the '''cosine function''' along with the '''sine''' '''function'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 2,'''&lt;br /&gt;
&lt;br /&gt;
uncheck the '''sin(t) checkbox'''&lt;br /&gt;
&lt;br /&gt;
check the '''sin(t) checkbox.'''&lt;br /&gt;
|&lt;br /&gt;
Now uncheck the '''sin(t)''' '''checkbox.'''&lt;br /&gt;
&lt;br /&gt;
The response of '''sine''' function is not visible now.&lt;br /&gt;
&lt;br /&gt;
If we check the '''sin(t)''' '''checkbox''' then the '''sine function''' response is again visible.&lt;br /&gt;
&lt;br /&gt;
This way we can perform the basic plotting using '''GUI.'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
This brings us to the end of this tutorial. &lt;br /&gt;
&lt;br /&gt;
Let us summarise.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Summary'''&lt;br /&gt;
|&lt;br /&gt;
In this tutorial, we have learnt:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;About '''Checkbox'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Generated graphs of the '''sine''' and '''cosine functions''' using '''GUI'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Assignment'''&lt;br /&gt;
|&lt;br /&gt;
As an assignment, please do the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Add two '''Checkboxes''' to the current '''GUI''' to find:&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;inverse of '''sin(t)''' and&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;inverse of '''cos(t)'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Display the response of a system using an '''Axes'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide: &lt;br /&gt;
&lt;br /&gt;
'''About Spoken Tutorial Project'''&lt;br /&gt;
|&lt;br /&gt;
The video at the following link summarises the '''Spoken Tutorial''' project.&lt;br /&gt;
&lt;br /&gt;
Please download and watch it.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide: &lt;br /&gt;
&lt;br /&gt;
'''Spoken Tutorial Workshops'''&lt;br /&gt;
|&lt;br /&gt;
We conduct workshops using '''Spoken Tutorials''' and give certificates.&lt;br /&gt;
&lt;br /&gt;
Please contact us. &lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Answers for THIS Spoken Tutorial''': &lt;br /&gt;
| Please post your timed queries in this forum.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''FOSSEE Forum'''&lt;br /&gt;
| Please post your general and technical queries on '''Scilab''' in this forum.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Textbook Companion project'''&lt;br /&gt;
|&lt;br /&gt;
The '''FOSSEE''' team coordinates the '''TBC''' project.&lt;br /&gt;
&lt;br /&gt;
For more details, please visit this site.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Lab Migration'''&lt;br /&gt;
|&lt;br /&gt;
The '''FOSSEE''' team coordinates the '''Lab Migration''' project.&lt;br /&gt;
&lt;br /&gt;
For more details, please visit this site.&lt;br /&gt;
|-&lt;br /&gt;
| Show Slide: '''Acknowledgements'''&lt;br /&gt;
| The '''Spoken Tutorial''' project is funded by the '''Ministry of Education, Government of India'''.&lt;br /&gt;
|-&lt;br /&gt;
| Show Slide: '''Thank you'''&lt;br /&gt;
|&lt;br /&gt;
This is '''Iswariya Sasikumar,''' a '''FOSSEE''' intern 2021, IIT Bombay signing off.&lt;br /&gt;
&lt;br /&gt;
Thanks for joining.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Iswariyas</name></author>	</entry>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php/GUI-in-Scilab/C2/Creating-a-GUI-based-exponent-calculator/English</id>
		<title>GUI-in-Scilab/C2/Creating-a-GUI-based-exponent-calculator/English</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php/GUI-in-Scilab/C2/Creating-a-GUI-based-exponent-calculator/English"/>
				<updated>2021-08-06T17:54:37Z</updated>
		
		<summary type="html">&lt;p&gt;Iswariyas: Created page with &amp;quot;'''Title of script''': Creating a '''GUI''' based exponent calculator  '''Author: Rashmi Patankar and Iswariya Sasikumar'''  {| class= &amp;quot;wikitable&amp;quot; ! '''Visual Cue''' ! '''Narr...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Title of script''': Creating a '''GUI''' based exponent calculator&lt;br /&gt;
&lt;br /&gt;
'''Author: Rashmi Patankar and Iswariya Sasikumar'''&lt;br /&gt;
&lt;br /&gt;
{| class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
! '''Visual Cue'''&lt;br /&gt;
! '''Narration'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Title Slide'''&lt;br /&gt;
|&lt;br /&gt;
Hello and welcome to the Spoken Tutorial on&lt;br /&gt;
&lt;br /&gt;
“'''Creating a GUI based exponent calculator”.'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Learning Objectives'''&lt;br /&gt;
|&lt;br /&gt;
In this tutorial, we will learn how to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Calculate the '''exponent''' of a number using '''GUI''' and&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Use of '''strtod command'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''System Requirements'''&lt;br /&gt;
&lt;br /&gt;
'''Only narration'''&lt;br /&gt;
|&lt;br /&gt;
To record this tutorial, I am using&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''Windows 10 OS'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''Scilab 6.1.0 and'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;'''GUI Builder Toolbox 4.2.1'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The process demonstrated in this tutorial is identical in '''Linux OS''' also.&lt;br /&gt;
&lt;br /&gt;
Annotations are added to the tutorial if there are any differences.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Pre-requisites'''&lt;br /&gt;
&lt;br /&gt;
https://spoken-tutorial.org&lt;br /&gt;
|&lt;br /&gt;
To follow this tutorial:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;The learner must have basic knowledge of '''Scilab''' and '''Graphical User Interface.'''&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;For pre-requisite '''Scilab''' tutorials please visit this website.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Code Files'''&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;The files used in this tutorial are provided in the '''Code files''' link.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Please download and extract the files.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Make a copy and then use them while practising.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUIBuilder toolbox''',&lt;br /&gt;
&lt;br /&gt;
hover cursor over '''GUIBuilder Palette''' window and '''Graphic window number 1'''.&lt;br /&gt;
|&lt;br /&gt;
I have already opened the '''GUIBuilder toolbox.'''&lt;br /&gt;
&lt;br /&gt;
As we can see there are two windows.&lt;br /&gt;
&lt;br /&gt;
The '''GUIBuilder Palette''' window is located on the left side.&lt;br /&gt;
&lt;br /&gt;
The '''Graphic window number 1''' is on the right side.&lt;br /&gt;
&lt;br /&gt;
Let us start by creating the '''GUI'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
To calculate the '''exponent''' of a number, we need two inputs.&lt;br /&gt;
&lt;br /&gt;
The first input is a '''base''' number and the second input is an '''exponent'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUIBuilder Palette''',&lt;br /&gt;
&lt;br /&gt;
click '''Edit.'''&lt;br /&gt;
| For the first input, go to the '''GUIBuilder Palette''' and click on '''Edit'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Scilab Multiple Values Request''' window,&lt;br /&gt;
&lt;br /&gt;
type '''ed_base''' in '''Tag''' field,&lt;br /&gt;
&lt;br /&gt;
type '''Enter''' '''the base''' in '''String''' field'''.'''&lt;br /&gt;
&lt;br /&gt;
Click on '''OK.'''&lt;br /&gt;
|&lt;br /&gt;
A window named '''Scilab Multiple Values Request''' will open.&lt;br /&gt;
&lt;br /&gt;
Type '''ed underscore base''' as the '''Tag''' and '''Enter the base''' as the '''String'''.&lt;br /&gt;
&lt;br /&gt;
Then click on '''OK'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 1,'''&lt;br /&gt;
&lt;br /&gt;
Place the '''Edit''' box in window's top left side.&lt;br /&gt;
&lt;br /&gt;
Hover cursor over an '''Edit''' box.&lt;br /&gt;
|&lt;br /&gt;
Switch to the '''Graphic window number 1'''.&lt;br /&gt;
&lt;br /&gt;
Place the '''Edit box''' in the window's top left side, by considering a suitable size.&lt;br /&gt;
&lt;br /&gt;
An '''Edit box''' with the '''string “Enter the base”''' appears.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUIBuilder palette''',&lt;br /&gt;
&lt;br /&gt;
click on '''Edit'''.&lt;br /&gt;
| Let us take another '''Edit box''' for the second input.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Scilab Multiple Values Request''' window''','''&lt;br /&gt;
&lt;br /&gt;
type '''ed_exponent''' in '''Tag''' field,&lt;br /&gt;
&lt;br /&gt;
type '''Enter''' '''an exponent''' in '''String''' field'''.'''&lt;br /&gt;
&lt;br /&gt;
Click on '''OK.'''&lt;br /&gt;
|&lt;br /&gt;
I will type '''ed underscore exponent''' as the '''Tag''' and '''Enter''' '''an exponent''' as the '''String'''.&lt;br /&gt;
&lt;br /&gt;
Then click on '''OK'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 1,'''&lt;br /&gt;
&lt;br /&gt;
Place the '''Edit''' box in window's top right side.&lt;br /&gt;
&lt;br /&gt;
Hover cursor over an '''Edit''' box.&lt;br /&gt;
|&lt;br /&gt;
Consider a suitable size of the '''Edit''' box.&lt;br /&gt;
&lt;br /&gt;
Place it in the top right side of the '''Graphic window number 1'''.&lt;br /&gt;
&lt;br /&gt;
An '''Edit box''' with the '''string “Enter an exponent”''' appears.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUIBuilder Palette''' window,&lt;br /&gt;
&lt;br /&gt;
click on '''Text'''.&lt;br /&gt;
| To display '''output''', go to the '''GUIBuilder Palette''' and click on '''Text'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Scilab Multiple Values Request''' window,&lt;br /&gt;
&lt;br /&gt;
type '''txt_output''' in '''Tag''' field'''.'''&lt;br /&gt;
&lt;br /&gt;
Click on '''OK.'''&lt;br /&gt;
|&lt;br /&gt;
I will type '''txt underscore output''' as the '''Tag'''.&lt;br /&gt;
&lt;br /&gt;
Keep the '''String''' field empty.&lt;br /&gt;
&lt;br /&gt;
We will not display any messages until we receive from the '''user'''.&lt;br /&gt;
&lt;br /&gt;
Then click on '''OK'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 1,'''&lt;br /&gt;
&lt;br /&gt;
place the '''Text''' box at bottom.&lt;br /&gt;
&lt;br /&gt;
Hover cursor over '''Text''' box.&lt;br /&gt;
|&lt;br /&gt;
I will place the '''Text box''' at the bottom of the '''Graphic window number 1'''.&lt;br /&gt;
&lt;br /&gt;
A '''Text box''' with the '''string “UnName3”''' appears.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUIBuilder Palette window''',&lt;br /&gt;
&lt;br /&gt;
click on '''Pushbutton'''.&lt;br /&gt;
|&lt;br /&gt;
To perform the calculations, I will add a '''pushbutton'''.&lt;br /&gt;
&lt;br /&gt;
Go to '''GUIBuilder Palette''' and click on '''Pushbutton'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On the '''Scilab Multiple Values Request''' window,&lt;br /&gt;
&lt;br /&gt;
type '''pb_cal''' in '''Tag''' field and type '''Calculate''' in '''String''' field'''.'''&lt;br /&gt;
&lt;br /&gt;
Click on '''OK.'''&lt;br /&gt;
|&lt;br /&gt;
Further I will type '''pb underscore cal''' as the '''Tag''' and '''Calculate''' as the '''String''' for the '''pushbutton'''.&lt;br /&gt;
&lt;br /&gt;
Then click on '''OK'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 1,'''&lt;br /&gt;
&lt;br /&gt;
place the '''Pushbutton''' in the middle.&lt;br /&gt;
&lt;br /&gt;
Hover cursor over '''Pushbutton.'''&lt;br /&gt;
&lt;br /&gt;
Hover cursor over two '''Edit''' boxes and '''Text''' box.&lt;br /&gt;
|&lt;br /&gt;
Let us place the '''Pushbutton''' in the middle of the '''Graphic window number 1'''.&lt;br /&gt;
&lt;br /&gt;
A '''pushbutton''' with the '''string “Calculate”''' appears.&lt;br /&gt;
&lt;br /&gt;
As a result, the '''pushbutton''' has two '''Edit boxes''' above it and a '''Text box''' below it.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
| Now the '''GUI''' part is completed.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUIBuilder Palette''' window,&lt;br /&gt;
&lt;br /&gt;
'''Generate&amp;amp;gt;&amp;amp;gt;Generate GUI code.'''&lt;br /&gt;
|&lt;br /&gt;
To save this file, go to the '''GUIBuilder Palette'''.&lt;br /&gt;
&lt;br /&gt;
Click on '''Generate''' and then on the '''Generate GUI code'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''uiputfile''' window,&lt;br /&gt;
&lt;br /&gt;
save as '''exponent-calculator'''.&lt;br /&gt;
&lt;br /&gt;
Click on '''Save.'''&lt;br /&gt;
&lt;br /&gt;
Video-editor: Pls put a textbox on screen. “In Ubuntu Linux OS, click on Ok button.”&lt;br /&gt;
|&lt;br /&gt;
I will save this file as '''exponent-calculator.'''&lt;br /&gt;
&lt;br /&gt;
Click on '''Save'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''GUI created window,'''&lt;br /&gt;
&lt;br /&gt;
click on '''OK.'''&lt;br /&gt;
|&lt;br /&gt;
A pop-up opens with the message “'''GUI created successfully'''.”&lt;br /&gt;
&lt;br /&gt;
Click on '''OK'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''SciNotes''' window,&lt;br /&gt;
&lt;br /&gt;
highlight '''handles''' for '''base, exponent output''' and '''Calculate'''.&lt;br /&gt;
|&lt;br /&gt;
We can see that the corresponding '''Scilab code''' has been generated.&lt;br /&gt;
&lt;br /&gt;
Notice the '''handles''' and '''properties''' of the objects we took on a '''graphic window'''.&lt;br /&gt;
|-&lt;br /&gt;
| Highlight '''handles.ed_base'''.&lt;br /&gt;
| '''handles dot ed underscore base''' is the '''handle''' for '''base'''.&lt;br /&gt;
|-&lt;br /&gt;
| Highlight '''handles.ed_exponent'''.&lt;br /&gt;
| '''handles dot ed underscore exponent''' is the '''handle''' for '''exponent'''.&lt;br /&gt;
|-&lt;br /&gt;
| Highlight '''handles.txt_output.'''.&lt;br /&gt;
| '''handles dot txt underscore output''' is the '''handle''' for '''output.'''&lt;br /&gt;
|-&lt;br /&gt;
| Highlight '''handles.pb_cal.'''&lt;br /&gt;
| '''handles dot pb underscore cal''' is the '''handle''' for '''Pushbutton.'''&lt;br /&gt;
|-&lt;br /&gt;
| Hover cursor over '''pb_cal_callback''' function.&lt;br /&gt;
| Now let us write a '''function definition''' for '''pb_cal_callback function'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Cursor on '''SciNotes''' window,&lt;br /&gt;
&lt;br /&gt;
type within '''pb_cal_callback'''.&lt;br /&gt;
&lt;br /&gt;
Type,&lt;br /&gt;
&lt;br /&gt;
'''base = strtod(handles.ed_base.string)'''&lt;br /&gt;
&lt;br /&gt;
'''exponent = strtod(handles.ed_exponent.string)'''&lt;br /&gt;
&lt;br /&gt;
'''out = base^exponent'''&lt;br /&gt;
&lt;br /&gt;
'''handles.txt_output.string = string(out)'''&lt;br /&gt;
|&lt;br /&gt;
Enter the code as seen here with the same syntax.&lt;br /&gt;
&lt;br /&gt;
The same code can be found under the '''Code files''' section.&lt;br /&gt;
&lt;br /&gt;
You can use it as explained earlier in this tutorial.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''base = strtod(handles.ed_base.string)'''&lt;br /&gt;
| The first line assigns the user input for a '''base''' value to the '''variable ‘base’'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''exponent = strtod(handles.ed_exponent.string)'''&lt;br /&gt;
| The second line assigns the user input for an '''exponent''' to the '''variable ‘exponent’'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''SciNotes''' window,&lt;br /&gt;
&lt;br /&gt;
within '''pb_cal_callback.'''&lt;br /&gt;
&lt;br /&gt;
highlight '''strtod''' command.&lt;br /&gt;
|&lt;br /&gt;
It is not possible to do calculations when the value is in '''string''' format.&lt;br /&gt;
&lt;br /&gt;
Hence I have put the '''handles''' inside the '''strtod command.'''&lt;br /&gt;
&lt;br /&gt;
This '''command''' will convert the value from the '''string''' format to a '''decimal''' format.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''out = base^exponent'''&lt;br /&gt;
|&lt;br /&gt;
Notice the next line.&lt;br /&gt;
&lt;br /&gt;
This equation will perform the calculations.&lt;br /&gt;
&lt;br /&gt;
The final result will be stored in the '''variable ‘out.''''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Highlight,&lt;br /&gt;
&lt;br /&gt;
'''handles.txt_output.string = string(out)'''&lt;br /&gt;
| The last line will give the value of a '''variable ‘out’''' to the '''Text box'''.&lt;br /&gt;
|-&lt;br /&gt;
| Press '''Ctrl+S.'''&lt;br /&gt;
| Let us save all our work by pressing '''Control''' and '''S''' keys together.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Scinotes''' window,&lt;br /&gt;
&lt;br /&gt;
'''Execute'''&amp;amp;gt;&amp;amp;gt;'''file''' '''with echo'''&lt;br /&gt;
|&lt;br /&gt;
'''Execute''' this by clicking '''Execute''' on the '''menubar''' and then on '''File with echo'''.&lt;br /&gt;
&lt;br /&gt;
The '''Graphic window number 2''' opens.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 2,'''&lt;br /&gt;
&lt;br /&gt;
delete '''Enter the base. '''&lt;br /&gt;
&lt;br /&gt;
Type '''2.'''&lt;br /&gt;
&lt;br /&gt;
Delete '''Enter an exponent.'''&lt;br /&gt;
&lt;br /&gt;
Type '''4'''.&lt;br /&gt;
|&lt;br /&gt;
Now let us test the '''GUI.'''&lt;br /&gt;
&lt;br /&gt;
I will calculate '''4''' to the '''power 2'''.&lt;br /&gt;
&lt;br /&gt;
Delete the '''string “Enter the base”''' from the '''Edit box''' and type '''4'''.&lt;br /&gt;
&lt;br /&gt;
Delete the '''string “Enter an exponent”''' from the '''Edit box''' and type '''2'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Graphic window number 2,'''&lt;br /&gt;
&lt;br /&gt;
click on '''Calculate Pushbutton'''.&lt;br /&gt;
&lt;br /&gt;
Hover cursor over '''Text''' box.&lt;br /&gt;
|&lt;br /&gt;
Then click on the '''Calculate Pushbutton.'''&lt;br /&gt;
&lt;br /&gt;
The '''Text box''' shows the desired answer of '''16''' as we expected.&lt;br /&gt;
&lt;br /&gt;
This way we can perform numeric calculations using '''GUI''' in '''Scilab'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Summary'''&lt;br /&gt;
|&lt;br /&gt;
This brings us to the end of this tutorial. Let us summarise.&lt;br /&gt;
&lt;br /&gt;
In this tutorial, we have:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Calculated the '''exponent''' of a number using '''GUI''' and&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Used '''strtod command'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Assignment'''&lt;br /&gt;
|&lt;br /&gt;
As an assignment activity, please do the following.&lt;br /&gt;
&lt;br /&gt;
Create a '''GUI''' which has&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Two '''Edit boxes''' to take two numbers from the '''user'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;Four '''pushbuttons''' to perform '''addition''', '''subtraction''', '''multiplication''' and '''division'''.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;blockquote&amp;gt;&amp;lt;p&amp;gt;One '''Text box''' to display the answer of these operations.&amp;lt;/p&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''About Spoken Tutorial Project'''&lt;br /&gt;
|&lt;br /&gt;
The video at the following link summarises the '''Spoken Tutorial''' project.&lt;br /&gt;
&lt;br /&gt;
Please download and watch it.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Spoken Tutorial Workshops'''&lt;br /&gt;
|&lt;br /&gt;
We conduct workshops using '''Spoken Tutorials''' and give certificates.&lt;br /&gt;
&lt;br /&gt;
Please contact us.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Answers for THIS Spoken Tutorial'''&lt;br /&gt;
| Please post your timed queries in this forum.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''FOSSEE Forum'''&lt;br /&gt;
| Please post your general and technical queries on '''Scilab''' in this forum.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Textbook Companion project'''&lt;br /&gt;
|&lt;br /&gt;
The '''FOSSEE''' team coordinates the '''TBC''' project.&lt;br /&gt;
&lt;br /&gt;
For more details, please visit these sites.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Lab Migration'''&lt;br /&gt;
|&lt;br /&gt;
The '''FOSSEE''' team coordinates the '''Lab Migration''' project.&lt;br /&gt;
&lt;br /&gt;
For more details, please visit this site.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Acknowledgement'''&lt;br /&gt;
| The '''Spoken Tutorial''' project is funded by the '''Ministry of Education, Government of India'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Thank you'''&lt;br /&gt;
|&lt;br /&gt;
This is '''Iswariya Sasikumar''', a '''FOSSEE''' intern 2021,IIT Bombay signing off.&lt;br /&gt;
&lt;br /&gt;
Thanks for joining.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Iswariyas</name></author>	</entry>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php/Scilab/C4/Interactive-Simulation-in-Xcos-using-slider/English</id>
		<title>Scilab/C4/Interactive-Simulation-in-Xcos-using-slider/English</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php/Scilab/C4/Interactive-Simulation-in-Xcos-using-slider/English"/>
				<updated>2021-08-06T17:49:20Z</updated>
		
		<summary type="html">&lt;p&gt;Iswariyas: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Title of script''': Interactive Simulation in '''Xcos''' Using '''Slider'''&lt;br /&gt;
&lt;br /&gt;
'''Author: Rupak Rokade and Iswariya Sasikumar'''&lt;br /&gt;
&lt;br /&gt;
{| class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
! '''Visual Cue'''&lt;br /&gt;
! '''Narration'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Title Slide'''&lt;br /&gt;
| Hello and welcome to the Spoken Tutorial on “'''Interactive Simulation in Xcos Using Slider'''”.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Learning Objectives'''&lt;br /&gt;
|&lt;br /&gt;
In this tutorial, we will learn how to:&lt;br /&gt;
&lt;br /&gt;
* Use '''Slider''' in '''Xcos'''&lt;br /&gt;
* Use '''TKSCALE''' block for simulation and&lt;br /&gt;
* Run '''Xcos''' simulations in real-time&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''System Requirements'''&lt;br /&gt;
|&lt;br /&gt;
To record this tutorial, I am using&lt;br /&gt;
&lt;br /&gt;
* '''Windows 10 OS'''&lt;br /&gt;
* '''Scilab 6.1.0 '''&lt;br /&gt;
&lt;br /&gt;
The process demonstrated in this tutorial is identical in '''Linux''' OS also.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Pre-requisites'''&lt;br /&gt;
&lt;br /&gt;
https://www.spoken-tutorial.org&lt;br /&gt;
|&lt;br /&gt;
To follow this tutorial, you should have&lt;br /&gt;
&lt;br /&gt;
* Basic knowledge of '''Scilab and Xcos.'''&lt;br /&gt;
* If not, for relevant tutorials please visit this website.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Interactive Simulation'''&lt;br /&gt;
|&lt;br /&gt;
* Interactive simulation gives a way to change the parameters during simulation.&lt;br /&gt;
* The parameters can be changed by using the '''Slider.'''&lt;br /&gt;
* In this tutorial we will see how to change values using the '''TKSCALE''' block as a slider .&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On the '''Scilab console''',&lt;br /&gt;
&lt;br /&gt;
'''Applications&amp;amp;gt;&amp;amp;gt;Xcos'''.&lt;br /&gt;
|&lt;br /&gt;
Open the '''Scilab console'''.&lt;br /&gt;
&lt;br /&gt;
In the menu bar click on '''Applications''' and select '''Xcos.'''&lt;br /&gt;
|-&lt;br /&gt;
| Cursor on the '''Palette browser window''' and '''Untitled-Xcos window'''.&lt;br /&gt;
|&lt;br /&gt;
Notice the '''Palette browser window''' is located on the left side.&lt;br /&gt;
&lt;br /&gt;
The '''Untitled''' - '''Xcos window''' is on the right side.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Cursor on the '''Palette browser window''',&lt;br /&gt;
&lt;br /&gt;
'''Sources&amp;amp;gt;&amp;amp;gt;TKSCALE''' .&lt;br /&gt;
|&lt;br /&gt;
In the '''Palette browser-Xcos''' window, Click on '''Sources''' '''palette.'''&lt;br /&gt;
&lt;br /&gt;
In the right panel, scroll down and click on the '''TKSCALE''' block'''.'''&lt;br /&gt;
|-&lt;br /&gt;
| Cursor on '''TKSCALE''' and '''Untitled-Xcos window'''.&lt;br /&gt;
| Let us drag and drop this block in the '''Untitled-Xcos window'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On the '''Palette browser window''',&lt;br /&gt;
&lt;br /&gt;
'''Sinks&amp;amp;gt;&amp;amp;gt;CSCOPE.'''&lt;br /&gt;
|&lt;br /&gt;
Next, go to the '''Palette browser-Xcos window'''.&lt;br /&gt;
&lt;br /&gt;
Click on the '''sinks palette'''.&lt;br /&gt;
&lt;br /&gt;
In the right panel, scroll down and select the '''CSCOPE''' block.&lt;br /&gt;
&lt;br /&gt;
Now, drag and drop it after the '''TKSCALE''' block.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Untitled-Xcos window,'''&lt;br /&gt;
&lt;br /&gt;
Double-click on '''TKSCALE'''.&lt;br /&gt;
|&lt;br /&gt;
Next we will see the parameters for the '''TKSCALE''' block.&lt;br /&gt;
&lt;br /&gt;
Double click on the '''TKSCALE''' block.&lt;br /&gt;
|-&lt;br /&gt;
| On '''Scilab Multiple Values Request''',&lt;br /&gt;
|&lt;br /&gt;
A window named '''Scilab Multiple Values Request''' appears.&lt;br /&gt;
&lt;br /&gt;
It displays the '''TKSCALE''' block parameters.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Point to the '''Min value'''.&lt;br /&gt;
&lt;br /&gt;
Point to the '''Max value'''.&lt;br /&gt;
&lt;br /&gt;
Point to the '''Normalization.'''&lt;br /&gt;
&lt;br /&gt;
Click on '''OK.'''&lt;br /&gt;
|&lt;br /&gt;
Here, '''“Min value” -10''' represents the minimum value in the range of the slider scale.&lt;br /&gt;
&lt;br /&gt;
'''“Max value” 10''' represents the maximum value in the range of the slider scale.&lt;br /&gt;
&lt;br /&gt;
And '''“Normalization” 1''' represents the interval value of the slider scale.&lt;br /&gt;
&lt;br /&gt;
Click on '''OK'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Point to the '''black input''' of '''CSCOPE.'''&lt;br /&gt;
&lt;br /&gt;
Point to the '''red input''' of '''CSCOPE.'''&lt;br /&gt;
|&lt;br /&gt;
The black '''input port''' in the '''CSCOPE''' carries the data values.&lt;br /&gt;
&lt;br /&gt;
The red '''input port''' in the '''CSCOPE''' represents the events.&lt;br /&gt;
&lt;br /&gt;
The '''red input''' can connect only to a block that generates the events.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Cursor on the '''Palette browser window''',&lt;br /&gt;
&lt;br /&gt;
'''Sources&amp;amp;gt;&amp;amp;gt;CLOCK _c.'''&lt;br /&gt;
&lt;br /&gt;
As per narration.&lt;br /&gt;
|&lt;br /&gt;
To generate the events, go to the '''Palette browser-Xcos window'''.&lt;br /&gt;
&lt;br /&gt;
Click on the '''Sources''' Palette.&lt;br /&gt;
&lt;br /&gt;
Then click on the '''CLOCK underscore c''' block.&lt;br /&gt;
&lt;br /&gt;
Drag and drop the '''CLOCK underscore c''' block above the '''CSCOPE''' block.&lt;br /&gt;
|-&lt;br /&gt;
| Hover cursor on '''Untitled-Xcos window'''.&lt;br /&gt;
|&lt;br /&gt;
We have collected all the required blocks in the '''Untitled-Xcos window''' to do the simulation.&lt;br /&gt;
&lt;br /&gt;
Let us now connect the blocks together.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Untitled-Xcos window''',&lt;br /&gt;
&lt;br /&gt;
Connect as per narration'''.'''&lt;br /&gt;
|&lt;br /&gt;
Select the '''black output port''' of the '''TKSCALE''' block.&lt;br /&gt;
&lt;br /&gt;
Connect it to the '''black input port''' of the '''CSCOPE''' block.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Untitled-Xcos window''',&lt;br /&gt;
&lt;br /&gt;
Connect as per narration'''.'''&lt;br /&gt;
|&lt;br /&gt;
Next select the red '''output port''' of the '''CLOCK underscore c''' block.&lt;br /&gt;
&lt;br /&gt;
Connect it to the red '''input port''' of the '''CSCOPE''' block.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Untitled-Xcos window,'''&lt;br /&gt;
&lt;br /&gt;
Connect as per narration&lt;br /&gt;
|&lt;br /&gt;
Next select the '''red input port''' of the '''TKSCALE''' block.&lt;br /&gt;
&lt;br /&gt;
Connect it to the '''line''' connecting '''CLOCK underscore c''' and '''CSCOPE''' block.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Untitled-Xcos window,'''&lt;br /&gt;
&lt;br /&gt;
Connect as per narration&lt;br /&gt;
|&lt;br /&gt;
Use the left mouse click to create line bends and then connect it to the line.&lt;br /&gt;
&lt;br /&gt;
Now let us simulate this file with the default values.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Untitled-Xcos window,'''&lt;br /&gt;
&lt;br /&gt;
Click on '''start'''.&lt;br /&gt;
|&lt;br /&gt;
To start the '''simulation''', go to the toolbar of the '''Untitled-Xcos window'''.&lt;br /&gt;
&lt;br /&gt;
Then click on the '''Start''' button that is of the shape of the play button.&lt;br /&gt;
|-&lt;br /&gt;
| Cursor on the '''Slider''' and the '''Graphic window'''.&lt;br /&gt;
|&lt;br /&gt;
Two windows get opened.&lt;br /&gt;
&lt;br /&gt;
The left window will display the '''slider'''.&lt;br /&gt;
&lt;br /&gt;
The right '''Graphic window''' will display the output of the system.&lt;br /&gt;
|-&lt;br /&gt;
| Hover cursor over '''slider'''&lt;br /&gt;
|&lt;br /&gt;
Notice that the '''slider''' opens and closes quickly.&lt;br /&gt;
&lt;br /&gt;
It doesn’t give a chance to make use of this '''slider'''.&lt;br /&gt;
&lt;br /&gt;
This is happening because '''Xcos''' is trying to simulate this file at computer time.&lt;br /&gt;
|-&lt;br /&gt;
| Close '''Graphic window'''&lt;br /&gt;
| To handle this problem, first close the '''Graphic window'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Untitled-Xcos window''',&lt;br /&gt;
&lt;br /&gt;
'''Simulation&amp;amp;gt;&amp;amp;gt;Setup'''&lt;br /&gt;
|&lt;br /&gt;
Then go to the menu bar of the '''Untitled-Xcos window''' and click on '''Simulation'''.&lt;br /&gt;
&lt;br /&gt;
Then click on '''Setup'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Set parameters window''',&lt;br /&gt;
&lt;br /&gt;
Cursor on '''Real time scaling'''&lt;br /&gt;
|&lt;br /&gt;
A pop up window named '''Set parameters''' appears.&lt;br /&gt;
&lt;br /&gt;
We will change the default value of the '''real time scaling''' to '''1.'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Hover cursor over '''Set parameters''' window.&lt;br /&gt;
&lt;br /&gt;
Click on '''OK'''.&lt;br /&gt;
|&lt;br /&gt;
Keep the other parameters unchanged.&lt;br /&gt;
&lt;br /&gt;
Then click on '''OK.'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Untitled-Xcos window''',&lt;br /&gt;
&lt;br /&gt;
Click on '''Start'''.&lt;br /&gt;
|&lt;br /&gt;
To start the '''simulation,''' go to the toolbar of the '''Untitled-Xcos window'''.&lt;br /&gt;
&lt;br /&gt;
Click on the '''Start''' button.&lt;br /&gt;
|-&lt;br /&gt;
| Cursor on '''Graphic window''' and '''slider'''&lt;br /&gt;
| A '''graphic window''' and the '''slider''' will open.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Hover cursor over the '''slider'''.&lt;br /&gt;
&lt;br /&gt;
Hover cursor over '''slider''' and '''Graphic window.'''&lt;br /&gt;
|&lt;br /&gt;
Now I’ll change the value of a parameter using a '''slider'''.&lt;br /&gt;
&lt;br /&gt;
Notice that I am changing the value while the simulation is running.&lt;br /&gt;
&lt;br /&gt;
Observe the changes on a '''Graphic window''' as I change the '''slider''' value.&lt;br /&gt;
&lt;br /&gt;
So this is how we can make the '''Xcos''' simulation interactive using a '''slider'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
| This brings us to the end of this tutorial. Let us summarise.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Summary'''&lt;br /&gt;
|&lt;br /&gt;
In this tutorial, we have learnt to:&lt;br /&gt;
&lt;br /&gt;
* Use '''Slider''' in '''Xcos'''&lt;br /&gt;
* Use '''TKSCALE''' block for simulation and&lt;br /&gt;
* Run '''Xcos''' simulations in real-time&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Assignment'''&lt;br /&gt;
|&lt;br /&gt;
As an assignment, please do the following.&lt;br /&gt;
&lt;br /&gt;
* Modify the '''Xcos''' diagram to have an autoscale feature (scale graph at runtime) in the graph.&lt;br /&gt;
* Hint: Explore the use of '''SCALE underscore CSCOPE''' to have the autoscale feature.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''About Spoken Tutorial Project'''&lt;br /&gt;
|&lt;br /&gt;
The video at the following link summarises the '''Spoken Tutorial''' project.&lt;br /&gt;
&lt;br /&gt;
Please download and watch it.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Spoken Tutorial Workshops'''&lt;br /&gt;
|&lt;br /&gt;
The '''Spoken Tutorial''' Project Team conducts workshops and gives certificates.&lt;br /&gt;
&lt;br /&gt;
For more details, please write to us.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Answers for THIS Spoken Tutorial'''&lt;br /&gt;
| Please post your timed queries in this forum.&lt;br /&gt;
|-&lt;br /&gt;
| Show Slide: '''FOSSEE Forum'''&lt;br /&gt;
| Please post your general and technical queries on '''Scilab''' in this forum.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Textbook Companion project.'''&lt;br /&gt;
|&lt;br /&gt;
The '''FOSSEE''' team coordinates the '''Textbook Companion project'''.&lt;br /&gt;
&lt;br /&gt;
We give '''Certificates''' and '''Honorarium''' to the contributors.&lt;br /&gt;
&lt;br /&gt;
For more details, please visit this site.&lt;br /&gt;
|-&lt;br /&gt;
| Show Slide: '''Lab Migration'''&lt;br /&gt;
|&lt;br /&gt;
The '''FOSSEE''' team coordinates the '''Lab Migration project'''.&lt;br /&gt;
&lt;br /&gt;
For more details, please visit this site.&lt;br /&gt;
|-&lt;br /&gt;
| Show Slide: '''Acknowledgements'''&lt;br /&gt;
| '''Spoken Tutorial''' and '''FOSSEE''' projects are funded by '''MoE''', '''Government of India'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|&lt;br /&gt;
This is '''Iswariya Sasikumar''' from FOSSEE intern 2021, IIT Bombay signing off.&lt;br /&gt;
&lt;br /&gt;
Thanks for joining.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Iswariyas</name></author>	</entry>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php/Scilab/C4/Interactive-Simulation-in-Xcos-using-slider/English</id>
		<title>Scilab/C4/Interactive-Simulation-in-Xcos-using-slider/English</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php/Scilab/C4/Interactive-Simulation-in-Xcos-using-slider/English"/>
				<updated>2021-08-06T17:43:24Z</updated>
		
		<summary type="html">&lt;p&gt;Iswariyas: Created page with &amp;quot;'''Title of script''': Interactive Simulation in '''Xcos''' Using '''Slider'''  '''Author: Rupak Rokade and Iswariya Sasikumar'''    {| class= &amp;quot;wikitable&amp;quot; | '''Visual Cue''' |...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Title of script''': Interactive Simulation in '''Xcos''' Using '''Slider'''&lt;br /&gt;
&lt;br /&gt;
'''Author: Rupak Rokade and Iswariya Sasikumar'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class= &amp;quot;wikitable&amp;quot;&lt;br /&gt;
| '''Visual Cue'''&lt;br /&gt;
| '''Narration'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Title Slide'''&lt;br /&gt;
| Hello and welcome to the Spoken Tutorial on “'''Interactive Simulation in Xcos Using Slider'''”.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Learning Objectives'''&lt;br /&gt;
|&lt;br /&gt;
In this tutorial, we will learn how to:&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''System Requirements'''&lt;br /&gt;
|&lt;br /&gt;
To record this tutorial, I am using &lt;br /&gt;
&lt;br /&gt;
The process demonstrated in this tutorial is identical in '''Linux '''OS also.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Pre-requisites'''&lt;br /&gt;
&lt;br /&gt;
https://www.spoken-tutorial.org&lt;br /&gt;
| To follow this tutorial, you should have&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Interactive Simulation'''&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On the '''Scilab console''',&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Applications&amp;amp;gt;&amp;amp;gt;Xcos'''.&lt;br /&gt;
|&lt;br /&gt;
Open the '''Scilab console'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the menu bar click on '''Applications '''and select '''Xcos.'''&lt;br /&gt;
|-&lt;br /&gt;
| Cursor on the '''Palette browser window '''and '''Untitled-Xcos window'''.&lt;br /&gt;
|&lt;br /&gt;
Notice the '''Palette browser window '''is located on the left side.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The '''Untitled '''- '''Xcos window '''is on the right side.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Cursor on the '''Palette browser window''',&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sources&amp;amp;gt;&amp;amp;gt;TKSCALE''' .&lt;br /&gt;
|&lt;br /&gt;
In the '''Palette browser-Xcos''' window, Click on '''Sources''' '''palette.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the right panel, scroll down and click on the '''TKSCALE '''block'''.'''&lt;br /&gt;
|-&lt;br /&gt;
| Cursor on '''TKSCALE '''and '''Untitled-Xcos window'''.&lt;br /&gt;
| Let us drag and drop this block in the '''Untitled-Xcos window'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On the '''Palette browser window''',&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sinks&amp;amp;gt;&amp;amp;gt;CSCOPE.'''&lt;br /&gt;
|&lt;br /&gt;
Next, go to the '''Palette browser-Xcos window'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click on the '''sinks palette'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the right panel, scroll down and select the '''CSCOPE '''block.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, drag and drop it after the '''TKSCALE''' block.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Untitled-Xcos window,'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Double-click on '''TKSCALE'''.&lt;br /&gt;
|&lt;br /&gt;
Next we will see the parameters for the '''TKSCALE '''block.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Double click on the '''TKSCALE '''block.&lt;br /&gt;
|-&lt;br /&gt;
| On '''Scilab Multiple Values Request''',&lt;br /&gt;
|&lt;br /&gt;
A window named '''Scilab Multiple Values Request '''appears.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It displays the '''TKSCALE '''block parameters.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Point to the '''Min value'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Point to the '''Max value'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Point to the '''Normalization.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click on '''OK.'''&lt;br /&gt;
|&lt;br /&gt;
Here, '''“Min value” -10''' represents the minimum value in the range of the slider scale.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''“Max value” 10''' represents the maximum value in the range of the slider scale.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And '''“Normalization” 1''' represents the interval value of the slider scale.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click on '''OK'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Point to the '''black input '''of '''CSCOPE.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Point to the''' red input '''of '''CSCOPE.'''&lt;br /&gt;
|&lt;br /&gt;
The black '''input port '''in the '''CSCOPE''' carries the data values.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The red '''input port '''in the '''CSCOPE''' represents the events.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The '''red input '''can connect only to a block that generates the events.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Cursor on the '''Palette browser window''',&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Sources&amp;amp;gt;&amp;amp;gt;CLOCK _c.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As per narration.&lt;br /&gt;
|&lt;br /&gt;
To generate the events, go to the '''Palette browser-Xcos window'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click on the '''Sources '''Palette.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then click on the '''CLOCK underscore c''' block.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Drag and drop the '''CLOCK underscore c''' block above the '''CSCOPE '''block.&lt;br /&gt;
|-&lt;br /&gt;
| Hover cursor on '''Untitled-Xcos window'''.&lt;br /&gt;
|&lt;br /&gt;
We have collected all the required blocks in the '''Untitled-Xcos window '''to do the simulation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Let us now connect the blocks together.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Untitled-Xcos window''',&lt;br /&gt;
&lt;br /&gt;
Connect as per narration'''.'''&lt;br /&gt;
|&lt;br /&gt;
Select the '''black output port''' of the '''TKSCALE''' block.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Connect it to the '''black input port''' of the '''CSCOPE '''block.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Untitled-Xcos window''',&lt;br /&gt;
&lt;br /&gt;
Connect as per narration'''.'''&lt;br /&gt;
|&lt;br /&gt;
Next select the red '''output port''' of the '''CLOCK underscore c''' block.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Connect it to the red '''input port''' of the '''CSCOPE''' block.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Untitled-Xcos window,'''&lt;br /&gt;
&lt;br /&gt;
Connect as per narration&lt;br /&gt;
|&lt;br /&gt;
Next select the '''red input port '''of the '''TKSCALE '''block.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Connect it to the '''line '''connecting '''CLOCK underscore c''' and '''CSCOPE''' block.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Untitled-Xcos window,'''&lt;br /&gt;
&lt;br /&gt;
Connect as per narration&lt;br /&gt;
|&lt;br /&gt;
Use the left mouse click to create line bends and then connect it to the line.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now let us simulate this file with the default values.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Untitled-Xcos window,'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click on '''start'''.&lt;br /&gt;
|&lt;br /&gt;
To start the '''simulation''', go to the toolbar of the '''Untitled-Xcos window'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then click on the '''Start '''button that is of the shape of the play button.&lt;br /&gt;
|-&lt;br /&gt;
| Cursor on the '''Slider '''and the '''Graphic window'''.&lt;br /&gt;
|&lt;br /&gt;
Two windows get opened.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The left window will display the '''slider'''. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The right '''Graphic window '''will display the output of the system.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Hover cursor over '''slider'''&lt;br /&gt;
|&lt;br /&gt;
Notice that the '''slider '''opens and closes quickly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It doesn’t give a chance to make use of this '''slider'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is happening because '''Xcos '''is trying to simulate this file at computer time.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Close '''Graphic window'''&lt;br /&gt;
| To handle this problem, first close the '''Graphic window'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Untitled-Xcos window''',&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Simulation&amp;amp;gt;&amp;amp;gt;Setup'''&lt;br /&gt;
|&lt;br /&gt;
Then go to the menu bar of the '''Untitled-Xcos window '''and click on '''Simulation'''.&lt;br /&gt;
&lt;br /&gt;
Then click on '''Setup'''.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Set parameters window''',&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Cursor on '''Real time scaling'''&lt;br /&gt;
|&lt;br /&gt;
A pop up window named '''Set parameters '''appears.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We will change the default value of the '''real time scaling '''to '''1.'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Hover cursor over '''Set parameters '''window.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click on '''OK'''.&lt;br /&gt;
|&lt;br /&gt;
Keep the other parameters unchanged.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then click on '''OK.'''&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On '''Untitled-Xcos window''',&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click on '''Start'''.&lt;br /&gt;
|&lt;br /&gt;
To start the '''simulation,''' go to the toolbar of the '''Untitled-Xcos window'''. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click on the '''Start '''button.&lt;br /&gt;
|-&lt;br /&gt;
| Cursor on '''Graphic window '''and '''slider'''&lt;br /&gt;
| A '''graphic window''' and the '''slider''' will open.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Hover cursor over the '''slider'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hover cursor over '''slider '''and '''Graphic window.'''&lt;br /&gt;
|&lt;br /&gt;
Now I’ll change the value of a parameter using a '''slider'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Notice that I am changing the value while the simulation is running.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Observe the changes on a '''Graphic window '''as I change the '''slider '''value.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So this is how we can make the '''Xcos '''simulation interactive using a '''slider'''.&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| This brings us to the end of this tutorial. Let us summarise.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Summary'''&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this tutorial, we have learnt to:&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Assignment'''&lt;br /&gt;
|&lt;br /&gt;
As an assignment, please do the following.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide: &lt;br /&gt;
&lt;br /&gt;
'''About Spoken Tutorial Project'''&lt;br /&gt;
|&lt;br /&gt;
The video at the following link summarises the '''Spoken Tutorial''' project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please download and watch it.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide: &lt;br /&gt;
&lt;br /&gt;
'''Spoken Tutorial Workshops'''&lt;br /&gt;
|&lt;br /&gt;
The '''Spoken Tutorial''' Project Team conducts workshops and gives certificates.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For more details, please write to us.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Answers for THIS Spoken Tutorial'''&lt;br /&gt;
| Please post your timed queries in this forum.&lt;br /&gt;
|-&lt;br /&gt;
| Show Slide: '''FOSSEE Forum'''&lt;br /&gt;
| Please post your general and technical queries on '''Scilab''' in this forum.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide:&lt;br /&gt;
&lt;br /&gt;
'''Textbook Companion project.'''&lt;br /&gt;
|&lt;br /&gt;
The '''FOSSEE '''team coordinates the '''Textbook Companion project'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We give '''Certificates '''and '''Honorarium '''to the contributors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For more details, please visit this site.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide: '''Lab Migration'''&lt;br /&gt;
|&lt;br /&gt;
The '''FOSSEE '''team coordinates the '''Lab Migration project'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For more details, please visit this site.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Show Slide: '''Acknowledgements'''&lt;br /&gt;
| '''Spoken Tutorial '''and '''FOSSEE '''projects are funded by '''MoE''', '''Government of India'''.&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
This is '''Iswariya Sasikumar''' from FOSSEE intern 2021, IIT Bombay signing off.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thanks for joining.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
''' '''&lt;/div&gt;</summary>
		<author><name>Iswariyas</name></author>	</entry>

	</feed>