<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Francisco Javier Moreno Vázquez</title>
    <description>The latest articles on DEV Community by Francisco Javier Moreno Vázquez (@fcomovaz).</description>
    <link>https://dev.to/fcomovaz</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F495363%2F8cfd1c81-76ab-4be2-86dc-994449f92988.jpeg</url>
      <title>DEV Community: Francisco Javier Moreno Vázquez</title>
      <link>https://dev.to/fcomovaz</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/fcomovaz"/>
    <language>en</language>
    <item>
      <title>Scilab: Run Scilab in VS Code</title>
      <dc:creator>Francisco Javier Moreno Vázquez</dc:creator>
      <pubDate>Sat, 08 Jan 2022 21:33:35 +0000</pubDate>
      <link>https://dev.to/fcomovaz/run-scilab-in-vs-code-3l39</link>
      <guid>https://dev.to/fcomovaz/run-scilab-in-vs-code-3l39</guid>
      <description>&lt;ul&gt;
&lt;li&gt;VS Code ❤ Scilab&lt;/li&gt;
&lt;li&gt;
Download Code Extensions

&lt;ul&gt;
&lt;li&gt;Scilab Extension&lt;/li&gt;
&lt;li&gt;Code Runner&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

Customize Code Runner for Scilab

&lt;ul&gt;
&lt;li&gt;Open &lt;code&gt;settings.json&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Add &lt;code&gt;code-runner.executorMap&lt;/code&gt; command&lt;/li&gt;
&lt;li&gt;Specify run mode instruction&lt;/li&gt;
&lt;li&gt;Add Scilab instruction to execute&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  VS Code ❤ Scilab
&lt;/h2&gt;

&lt;p&gt;Firstly, we need to have installed in our computer both &lt;a href="https://www.scilab.org/download/" rel="noopener noreferrer"&gt;Scilab&lt;/a&gt; and &lt;a href="https://code.visualstudio.com/download" rel="noopener noreferrer"&gt;VS Code&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Download Code Extensions
&lt;/h2&gt;

&lt;p&gt;We need only two extensions for run Scilab inside VS Code:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://marketplace.visualstudio.com/items?itemName=mammothb.scilab" rel="noopener noreferrer"&gt;Scilab&lt;/a&gt; by &lt;a href="https://marketplace.visualstudio.com/publishers/mammothb" rel="noopener noreferrer"&gt;mammothb&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://marketplace.visualstudio.com/items?itemName=formulahendry.code-runner" rel="noopener noreferrer"&gt;Code Runner&lt;/a&gt; by &lt;a href="https://marketplace.visualstudio.com/publishers/formulahendry" rel="noopener noreferrer"&gt;Jun Han&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Scilab Extension
&lt;/h3&gt;

&lt;p&gt;This extension is useful to make a highlight of the reserved word of Scilab syntaxis, this allow us to have our own customization in VS Code.&lt;br&gt;&lt;br&gt;
This is an example of the two sights of the Scilab in Code vs Scilab IDE:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Ffcomovaz%2Fblog-drafts%2Fmain%2Fimg%2Fscinotes-code.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Ffcomovaz%2Fblog-drafts%2Fmain%2Fimg%2Fscinotes-code.png" alt="Scilab Codes"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Code Runner
&lt;/h3&gt;

&lt;p&gt;This extension allow us run code snippets or code files for multiple languages and create custom commands.&lt;/p&gt;

&lt;h2&gt;
  
  
  Customize Code Runner for Scilab
&lt;/h2&gt;

&lt;p&gt;In this step we need to customize the &lt;code&gt;settings.json&lt;/code&gt; file, particulary, for the &lt;code&gt;code-runner.executorMap&lt;/code&gt;. In this case, I created a Github Repo where I explain my &lt;a href="https://github.com/fcomovaz/vscode-config" rel="noopener noreferrer"&gt;VS Code configurations&lt;/a&gt; you can access to it and follow the instructions there, anyway, I'll explain how to configurate the file in this post:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open &lt;code&gt;settings.json&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Add &lt;code&gt;code-runner.executorMap&lt;/code&gt; command.&lt;/li&gt;
&lt;li&gt;Specify run mode instruction.&lt;/li&gt;
&lt;li&gt;Add Scilab instruction to execute.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Open &lt;code&gt;settings.json&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;This is the file where you can overwrite the default configurations of the editor.&lt;/p&gt;

&lt;p&gt;You can access it with &lt;code&gt;Ctrl + ,&lt;/code&gt; and clicking like the image below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe38pxq8v45w8gw17z4rh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe38pxq8v45w8gw17z4rh.png" alt="settings.json"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Add &lt;code&gt;code-runner.executorMap&lt;/code&gt; command
&lt;/h3&gt;

&lt;p&gt;If you are used to move and customize VS Code extensions, this step won't be a problem for you, either way I will show you how to do it.&lt;/p&gt;

&lt;p&gt;In the &lt;code&gt;settings.json&lt;/code&gt; file you can find a blank file (or not) and how its own name specify, the instructions needs to be in JSON format.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;code-runner.executorMap&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{},&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;With this line we can begin to give instructions depending on any programming language we need to overwrite.&lt;/p&gt;

&lt;h3&gt;
  
  
  Specify run mode instruction
&lt;/h3&gt;

&lt;p&gt;Foremostly, we need to understand what is a run mode in Scilab.&lt;/p&gt;

&lt;p&gt;Scilab have 3 different ways to run its programs:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;Wscilex&lt;/code&gt;: runs the standar Scilab.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Wscilex-cli&lt;/code&gt;: in this mode, Scilab is started as command line with advanced features still available (graphics, export, xcos, scinotes, help browser, ...).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Scilex&lt;/code&gt;. this mode has two features:

&lt;ul&gt;
&lt;li&gt;This mode prevents loading the Java Virtual Machine. It starts faster and uses less memory.&lt;/li&gt;
&lt;li&gt;Scilab is started as command line interpreter without any advanced features requiring the JVM: graphics, export, xcos, scinotes, help browser, other java interfaces, the Java module,... are not available.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We only need to be focus on &lt;code&gt;Wscilex-cli&lt;/code&gt; and &lt;code&gt;Scilex&lt;/code&gt; because we are goin to search for the instalation folder of Scilab (in my case, Scilab is installed in &lt;code&gt;D:\Programs\scilab-6.1.0\&lt;/code&gt; so replace for your path).&lt;/p&gt;

&lt;h3&gt;
  
  
  Add Scilab instruction to execute
&lt;/h3&gt;

&lt;p&gt;If you want to run Scilab and visualize plots, graphs, images, etc, use the following script:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;code-runner.executorMap&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// run Scilab with graphic Functions&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;scilab&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;cd $dir &amp;amp;&amp;amp; D:&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s2"&gt;Programs&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s2"&gt;scilab-6.1.0&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s2"&gt;bin&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s2"&gt;WScilex-cli.exe -nb -f $fileName&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;But if you only want numerical results:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;

&lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;code-runner.executorMap&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// run Scilab from VSCode&lt;/span&gt;
        &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;scilab&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;cd $dir &amp;amp;&amp;amp; D:&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s2"&gt;Programs&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s2"&gt;scilab-6.1.0&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s2"&gt;bin&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s2"&gt;Scilex.exe -nb -quit -f $fileName&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;In both cases we have flags that specify different things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;-nb&lt;/code&gt;: "no banner": Cancels the display of the Scilab's loading message.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-quit&lt;/code&gt;: This option forces scilab to always exit after the instruction(s) passed with the -e option, or the script referred to by the -f option, have been executed, even in case of a runtime error. This option should always be used in batch mode.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-f file&lt;/code&gt;: This option execute the file which is specified.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For &lt;code&gt;$dir&lt;/code&gt; and &lt;code&gt;$fileName&lt;/code&gt;, these are options nativately used in code-runner configuration.&lt;/p&gt;

&lt;p&gt;And that is everything you need to begin with Scilab in VS Code!!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Ffcomovaz%2Fblog-drafts%2Fmain%2Fimg%2Fscilab-invitation.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Ffcomovaz%2Fblog-drafts%2Fmain%2Fimg%2Fscilab-invitation.PNG" alt="scilab hello"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>scilab</category>
      <category>course</category>
      <category>tutorial</category>
      <category>vscode</category>
    </item>
    <item>
      <title>Scilab: An Introductory Course</title>
      <dc:creator>Francisco Javier Moreno Vázquez</dc:creator>
      <pubDate>Sun, 02 Jan 2022 02:00:18 +0000</pubDate>
      <link>https://dev.to/fcomovaz/scilab-an-introductory-course-188o</link>
      <guid>https://dev.to/fcomovaz/scilab-an-introductory-course-188o</guid>
      <description>&lt;ul&gt;
&lt;li&gt;What is Scilab?&lt;/li&gt;
&lt;li&gt;
Why should you learn Scilab?

&lt;ul&gt;
&lt;li&gt;Advantages&lt;/li&gt;
&lt;li&gt;Disadvantages&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;What's next?&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What is Scilab?
&lt;/h2&gt;

&lt;p&gt;Scilab is a free and open source software for engineers &amp;amp; scientists, with a long history (first release in 1994) and a growing community.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_5TFy_Zf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ftp.sun.ac.za/ftp/pub/mirrors/scilab/www.scilab.org/images/scilab_logo.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_5TFy_Zf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ftp.sun.ac.za/ftp/pub/mirrors/scilab/www.scilab.org/images/scilab_logo.jpg" alt="Scilab Logo" title="scilab logo" width="451" height="261"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also, Scilab is a high level programming language for scientific programming. It enables a rapid prototyping of algorithms, without having to deal with the complexity of other more low level programming language such as C and Fortran.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why should you learn Scilab?
&lt;/h2&gt;

&lt;p&gt;Scilab is a powerful software and a pretty good alternative to the commercial Matlab, besides it's free and open source what allows us use it as we want.&lt;/p&gt;

&lt;h3&gt;
  
  
  Advantages
&lt;/h3&gt;

&lt;p&gt;I'll list yo some advantages about the us of Scilab as numerical computing software:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Open Source &amp;amp; Free&lt;/em&gt;: This's very useful because is easy to get and there is no problem when you use it.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Easy to use&lt;/em&gt;: Scilab doens't havea very complex programming language is very similar to Matlab syntaxis.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;OS compatible&lt;/em&gt;: It's available for any OS.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Lightweight software&lt;/em&gt;: In comparition to Matlab instalation, Scilab is much lighter than Matlab.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Disadvantages
&lt;/h3&gt;

&lt;p&gt;Likewise, Scilab has certain point i don't really like about it. So, I'm going to be very honest with you and I'll give you the pros/cons i find when i've used Scilab.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Small community&lt;/em&gt;: It's not a common software, for this reason its community is not as big as Matlab community.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Lack of functions&lt;/em&gt;: This is because of the lightweight of the software, it just includes indispensable functions to work.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Documentation looks old&lt;/em&gt;: Scilab has its official docummentation but the page and examples are not very friendly at first sight.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What's next?
&lt;/h2&gt;

&lt;p&gt;The first step to begin with Scilab develop is download it.&lt;br&gt;&lt;br&gt;
Scilab, being Open Source, is very easy to install in any kind of OS accessing from the &lt;a href="https://www.scilab.org/download/"&gt;Scilab download page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Once you got it installed, you can wath this short overview to Scilab:&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/VfNV7wr4338"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Nevertheless, sometimes you don't want to install programs because a lot of reasons, in this case you can use the &lt;a href="https://cloud.scilab.in/"&gt;Scilab Online Version&lt;/a&gt; which is mainteined by &lt;strong&gt;IITB&lt;/strong&gt; (&lt;em&gt;Indian Institute of Technology Bombay&lt;/em&gt;).&lt;/p&gt;

&lt;p&gt;As well as Matlab,  Scilab has its own IDE integrated in the instalation, you can use it but we going to implement Scilab execution in the Visual Studio Code Editor, you can download it from the &lt;a href="https://code.visualstudio.com/download"&gt;VS Code download page&lt;/a&gt;, we'll configure it in following posts.&lt;/p&gt;

</description>
      <category>scilab</category>
      <category>course</category>
      <category>learning</category>
    </item>
  </channel>
</rss>
