<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1190391999863276012</id><updated>2012-02-16T17:43:45.152-08:00</updated><title type='text'>note su scilab</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://lucacremascilab.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1190391999863276012/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://lucacremascilab.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>luca_crema</name><uri>http://www.blogger.com/profile/11879780712331229042</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>5</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1190391999863276012.post-917813636716859085</id><published>2009-12-20T04:04:00.000-08:00</published><updated>2009-12-20T04:05:10.922-08:00</updated><title type='text'>scicos tutorial</title><content type='html'>&lt;a href="http://www.scicos.org/documentations.html"&gt;scicos tutor&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1190391999863276012-917813636716859085?l=lucacremascilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lucacremascilab.blogspot.com/feeds/917813636716859085/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1190391999863276012&amp;postID=917813636716859085' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1190391999863276012/posts/default/917813636716859085'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1190391999863276012/posts/default/917813636716859085'/><link rel='alternate' type='text/html' href='http://lucacremascilab.blogspot.com/2009/12/scicos-tutorial.html' title='scicos tutorial'/><author><name>luca_crema</name><uri>http://www.blogger.com/profile/11879780712331229042</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1190391999863276012.post-8045351565195483908</id><published>2008-10-18T08:50:00.000-07:00</published><updated>2008-10-18T08:53:33.045-07:00</updated><title type='text'>Writing a Scilab-callable C routine</title><content type='html'>&lt;h2&gt;tratto da &lt;a style="color: rgb(51, 102, 255);" href="http://pramode.net/2005/08/09/1676/"&gt;qui&lt;/a&gt;&lt;br /&gt;&lt;/h2&gt;&lt;h2&gt;&lt;br /&gt;&lt;/h2&gt;&lt;h2 style="color: rgb(0, 0, 153);"&gt;&lt;a href="http://pramode.net/2005/08/09/1676/"&gt;&lt;span style="font-size:85%;"&gt;Phoenix and Scilab/C Interfacing&lt;/span&gt;&lt;/a&gt;&lt;/h2&gt;    &lt;h4&gt;&lt;span style="font-size:85%;"&gt;August 9th, 2005 · &lt;/span&gt;&lt;!-- by Pramode C.E --&gt;&lt;/h4&gt;    &lt;div class="entry"&gt;&lt;span style="font-size:85%;"&gt;Writing a Scilab-callable C routine&lt;/span&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;As is the case with most instances of foreign function interfacing, your C function&lt;br /&gt;should be `wrapped’ by another function which does all kinds of nitty-gritty&lt;br /&gt;stuff to massage the high-level language datatypes (like lists) to simple C types.&lt;br /&gt;Fortunately, Scilab comes with a program called `intersci’ which creates the&lt;br /&gt;wrapper functions automagically from a text file with some rather simple&lt;br /&gt;interface specifications. Let’s say we wish to write a function which takes in two&lt;br /&gt;numbers and returns its sum. Here is the C function (in a file called add.c):&lt;/span&gt;&lt;/p&gt; &lt;pre&gt;&lt;span style="font-size:85%;"&gt;int add_(int *a, int *b, int *c)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;*c = *a + *b;&lt;br /&gt;return 0;&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;And here is the interface specification (in a file add_wrap.desc):&lt;/span&gt;&lt;/p&gt; &lt;pre&gt;&lt;span style="font-size:85%;"&gt;add a b&lt;br /&gt;a vector 1&lt;br /&gt;b vector 1&lt;br /&gt;c vector 1&lt;br /&gt;&lt;br /&gt;add  a b c&lt;br /&gt;a integer&lt;br /&gt;b integer&lt;br /&gt;c integer&lt;br /&gt;&lt;br /&gt;out sequence c&lt;/span&gt;&lt;/pre&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;The first part of the interface spec specifies what the Scilab function takes as&lt;br /&gt;arguments (a and b, both vectors of length 1). The second part specifies what the&lt;br /&gt;C function takes as arguments (a, b and c, all of which should be pointers to integers,&lt;br /&gt;but which are simply written as `integer’ in the interface spec). The third part says&lt;br /&gt;that `c’ is an output variable, ie, a value `returned’ from the Scilab function.&lt;br /&gt;Note that the address of the object to be returned from the Scilab function is passed as an argument&lt;br /&gt;to the C function. You visualize a Scilab invocation:&lt;/span&gt;&lt;/p&gt; &lt;pre&gt;&lt;span style="font-size:85%;"&gt;c = add(a, b)&lt;/span&gt;&lt;/pre&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;getting transformed to a C function invocation of the form:&lt;/span&gt;&lt;/p&gt; &lt;pre&gt;&lt;span style="font-size:85%;"&gt;add(&amp;amp;a, &amp;amp;b, &amp;amp;c);&lt;/span&gt;&lt;/pre&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;Here are the steps to make this C function Scilab callable:&lt;/span&gt;&lt;/p&gt; &lt;ol&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt; Run the command `intersci-n’ with add_wrap.desc as argument. You should&lt;br /&gt;see several files, two of which are `add_wrap.c’ and `add_wrap_builder.sce’.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt; Run scilab and type the following at the Scilab prompt: &lt;/span&gt;&lt;pre&gt;&lt;span style="font-size:85%;"&gt;files = ['add.o', 'add_wrap.o']&lt;br /&gt;libs = []&lt;br /&gt;exec add_wrap_builder.sce&lt;br /&gt;exec loader.sce&lt;/span&gt;&lt;/pre&gt; &lt;/li&gt;&lt;/ol&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;Now you can invoke add(1,2) at the Scilab prompt and you will get the proper answer.&lt;br /&gt;(Note that Scilab doesn’t differentiate between a 1 element vector and a scalar&lt;br /&gt;quantity; thus [1] is same as 1).&lt;/span&gt;&lt;/p&gt; &lt;h3&gt;&lt;span style="font-size:85%;"&gt;Adding two vectors&lt;/span&gt;&lt;/h3&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;Here is another simple example.  Our C function is:&lt;/span&gt;&lt;/p&gt; &lt;pre&gt;&lt;span style="font-size:85%;"&gt;int addvect_(int *n, double *a, double *b, double *c)&lt;br /&gt;{&lt;br /&gt;int i;&lt;br /&gt;for(i = 0; i &lt; *n; i++)   c[i] = a[i] + b[i];  return 0; }&lt;/span&gt;&lt;/pre&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;The interface spec looks like this:&lt;/span&gt;&lt;/p&gt; &lt;pre&gt;&lt;span style="font-size:85%;"&gt;addvect a b&lt;br /&gt;a vector n&lt;br /&gt;b vector n&lt;br /&gt;c vector n&lt;br /&gt;&lt;br /&gt;addvect  n a b t&lt;br /&gt;n integer&lt;br /&gt;a double&lt;br /&gt;b double&lt;br /&gt;c double&lt;br /&gt;&lt;br /&gt;out sequence c&lt;br /&gt;********************&lt;/span&gt;&lt;/pre&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;We can call addvect from the Scilab prompt as shown below:&lt;/span&gt;&lt;/p&gt; &lt;pre&gt;&lt;span style="font-size:85%;"&gt;addvect([1,2,3], [4,5,6])&lt;/span&gt;&lt;/pre&gt; &lt;h3&gt;&lt;span style="font-size:85%;"&gt;Returning two vectors&lt;/span&gt;&lt;/h3&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;Here is a sample C function:&lt;/span&gt;&lt;/p&gt; &lt;pre&gt;&lt;span style="font-size:85%;"&gt;int addmulvect_(int *n, double *a, double *b, double *c, double *d)&lt;br /&gt;{&lt;br /&gt;int i;&lt;br /&gt;for(i = 0; i &lt; *n; i++)   c[i] = a[i] + b[i];   for(i = 0; i &lt; *n; i++)   d[i] = a[i] * b[i];   return 0; }&lt;/span&gt;&lt;/pre&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;And here is the interface description:&lt;/span&gt;&lt;/p&gt; &lt;pre&gt;&lt;span style="font-size:85%;"&gt;addmulvect a b&lt;br /&gt;a vector n&lt;br /&gt;b vector n&lt;br /&gt;c vector n&lt;br /&gt;d vector n&lt;br /&gt;&lt;br /&gt;addmulvect  n a b c d&lt;br /&gt;n integer&lt;br /&gt;a double&lt;br /&gt;b double&lt;br /&gt;c double&lt;br /&gt;d double&lt;br /&gt;&lt;br /&gt;out sequence c d&lt;/span&gt;&lt;/pre&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;The function can be called like this:&lt;/span&gt;&lt;/p&gt; &lt;pre&gt;&lt;span style="font-size:85%;"&gt;[p, q] = addmulvect([1,2,3], [4,5,6])&lt;/span&gt;&lt;/pre&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;We note that this function returns two vectors which get stored&lt;br /&gt;in `p’ and `q’.&lt;/span&gt;&lt;/p&gt;        &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1190391999863276012-8045351565195483908?l=lucacremascilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lucacremascilab.blogspot.com/feeds/8045351565195483908/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1190391999863276012&amp;postID=8045351565195483908' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1190391999863276012/posts/default/8045351565195483908'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1190391999863276012/posts/default/8045351565195483908'/><link rel='alternate' type='text/html' href='http://lucacremascilab.blogspot.com/2008/10/writing-scilab-callable-c-routine.html' title='Writing a Scilab-callable C routine'/><author><name>luca_crema</name><uri>http://www.blogger.com/profile/11879780712331229042</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1190391999863276012.post-4713781769123424719</id><published>2008-03-07T04:40:00.000-08:00</published><updated>2008-03-07T04:41:29.006-08:00</updated><title type='text'>sacco dei trucchetti</title><content type='html'>&lt;a href="http://pages.cs.aueb.gr/users/yiannisk/aps-06/sci-bot-1.5-html/sci-bot/sci-bot.html"&gt;bag of tricks on line&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1190391999863276012-4713781769123424719?l=lucacremascilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lucacremascilab.blogspot.com/feeds/4713781769123424719/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1190391999863276012&amp;postID=4713781769123424719' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1190391999863276012/posts/default/4713781769123424719'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1190391999863276012/posts/default/4713781769123424719'/><link rel='alternate' type='text/html' href='http://lucacremascilab.blogspot.com/2008/03/sacco-dei-trucchetti.html' title='sacco dei trucchetti'/><author><name>luca_crema</name><uri>http://www.blogger.com/profile/11879780712331229042</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1190391999863276012.post-9096405902713058201</id><published>2008-03-07T04:35:00.000-08:00</published><updated>2008-03-07T04:37:52.821-08:00</updated><title type='text'>calling of C/C++ routines from the Windows™ version of Scilab using Microsoft™'s Visual C++ compiler</title><content type='html'>&lt;div class="sect3"&gt;tratto da &lt;a href="http://pages.cs.aueb.gr/users/yiannisk/aps-06/sci-bot-1.5-html/sci-bot/x6087.html"&gt;qui&lt;/a&gt;&lt;br /&gt;&lt;h3 class="sect3"&gt;&lt;a name="sect-external-visual-cxx"&gt;&lt;/a&gt;&lt;/h3&gt;&lt;h3 class="sect3"&gt;&lt;br /&gt;&lt;/h3&gt;&lt;h3 class="sect3"&gt;&lt;a name="sect-external-visual-cxx"&gt;Visual C++ &lt;i class="emphasis"&gt;by Dave Sidlauskas&lt;/i&gt;&lt;/a&gt;&lt;/h3&gt;  &lt;a name="idx-external-visual-cxx"&gt;&lt;/a&gt;&lt;a name="idx-external-visual-cxx-see"&gt;&lt;/a&gt; &lt;p&gt;  This section illustrates the calling of C/C++ routines from the &lt;span class="trademark"&gt;Windows&lt;/span&gt;™ version of &lt;span class="application"&gt;Scilab&lt;/span&gt; using &lt;a href="http://www.microsoft.com/italy/msdn/prodotti/vs2005/editions/download/vc.mspx"&gt;&lt;span class="trademark"&gt;Microsoft&lt;/span&gt;™'s Visual C++&lt;/a&gt; compiler. The process is quite simple.&lt;/p&gt;  &lt;ol type="1"&gt;&lt;li&gt; &lt;p&gt;  Use &lt;span class="application"&gt;VC++&lt;/span&gt; create a DLL containing the C functions.&lt;/p&gt; &lt;/li&gt;&lt;li&gt; &lt;p&gt;  In &lt;span class="application"&gt;Scilab&lt;/span&gt;, use &lt;tt class="literal"&gt;link()&lt;/tt&gt; to load the DLL functions.&lt;/p&gt; &lt;/li&gt;&lt;li&gt; &lt;p&gt;  Use &lt;tt class="literal"&gt;fort()&lt;/tt&gt; to run the functions.&lt;/p&gt; &lt;/li&gt;&lt;/ol&gt;  &lt;p&gt;  In a little more detail:&lt;/p&gt;  &lt;ol type="1"&gt;&lt;li&gt; &lt;p&gt;  Use VC++ to create a DLL.&lt;/p&gt;  &lt;p&gt;  Start VC++, click &lt;span class="guimenu"&gt;FILE&lt;/span&gt;, &lt;span class="guimenuitem"&gt;NEW&lt;/span&gt;, and select &lt;span class="guilabel"&gt;WIN 32 Dynamic Link-Library&lt;/span&gt;. Give it a name and location and click &lt;span class="guibutton"&gt;OK&lt;/span&gt;. Then select &lt;span class="guimenuitem"&gt;Empty DLL&lt;/span&gt; and click &lt;span class="guibutton"&gt;Finish&lt;/span&gt;.&lt;/p&gt;  &lt;p&gt;  Prepare a source file and insert it into the project (&lt;span class="guimenu"&gt;Project&lt;/span&gt;, &lt;span class="guimenuitem"&gt;Add To Project&lt;/span&gt;). Then build the project (&lt;span class="keysym"&gt;F7&lt;/span&gt;).&lt;/p&gt;  &lt;p&gt;  A sample source file is shown below. The declaration &lt;tt class="literal"&gt;extern "C" declspec(dllexport)&lt;/tt&gt; is critical. Using this, the function name is exported correctly with no name mangling. This type of declaration is covered in the VC++ on-line documentation if you wish more details.&lt;/p&gt;  &lt;p&gt;  Also note that C files that are to be executed by a call to &lt;tt class="literal"&gt;fort()&lt;/tt&gt; are always void, returning no value. Values are returned via pointers in the function parameter list. For example, the parameter &lt;tt class="literal"&gt;*out&lt;/tt&gt; in &lt;tt class="function"&gt;matcpy_c&lt;/tt&gt; is the return value for that function.&lt;/p&gt;  &lt;pre class="programlisting"&gt;extern "C" _declspec(dllexport) void matset_c(double *mat,&lt;br /&gt;                                            const int *nrows,&lt;br /&gt;                                            const int *row,&lt;br /&gt;                                            const int *col,&lt;br /&gt;                                            double *val);&lt;br /&gt;&lt;br /&gt;extern "C" _declspec(dllexport) void matcpy_c(const double *in,&lt;br /&gt;                                            const int *nrow,&lt;br /&gt;                                            const int *ncol,&lt;br /&gt;                                            double *out);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;// matset&lt;br /&gt;&lt;br /&gt;// Set element in mat at row and col to val.&lt;br /&gt;// nrows is number of rows in mat.  Shows row&lt;br /&gt;// and col reference in a C function.&lt;br /&gt;// REMEMBER: C row or col = Scilab row or col-1.&lt;br /&gt;&lt;br /&gt;void matset_c(double *mat,&lt;br /&gt;            const int *nrows,&lt;br /&gt;            const int *row,&lt;br /&gt;            const int *col,&lt;br /&gt;            double *val)&lt;br /&gt;{&lt;br /&gt;      mat[*row - 1 + (*col - 1)*(*nrows)] = *val;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;// matcpy&lt;br /&gt;&lt;br /&gt;// Function to copy one matrix to another.&lt;br /&gt;&lt;br /&gt;void matcpy_c(const double *in,&lt;br /&gt;            const int *nrow,&lt;br /&gt;            const int *ncol,&lt;br /&gt;            double *out)&lt;br /&gt;{&lt;br /&gt;      int row, col;&lt;br /&gt;&lt;br /&gt;      for (col = 0; col &lt; *ncol; col++)                for (row = 0; row &lt; *nrow; row++)                        out[row + col*(*nrow)] = in[row + col*(*nrow)];  }       &lt;/pre&gt; &lt;/li&gt;&lt;li&gt; &lt;p&gt;  In &lt;span class="application"&gt;Scilab&lt;/span&gt;, use link to load the DLL functions.&lt;/p&gt;  &lt;pre class="programlisting"&gt;link("path\filename.dll", "FunctionName", "c")&lt;br /&gt;   &lt;br /&gt;&lt;/pre&gt;  &lt;p&gt;  The path is wherever you told VC++ to put your output. It is usually something like ProjectName\debug.&lt;/p&gt;  &lt;p&gt;  Link uses the &lt;span class="trademark"&gt;Windows&lt;/span&gt;™ &lt;tt class="function"&gt;LoadLibrary&lt;/tt&gt; function to load your DLL. See the VC++ on-line documentation for details.&lt;/p&gt; &lt;/li&gt;&lt;li&gt; &lt;p&gt;  Use &lt;tt class="literal"&gt;fort()&lt;/tt&gt; to execute your function.&lt;/p&gt;  &lt;p&gt;  Actually it is probably better to prepare a wrapper function to reduce the clutter of &lt;tt class="literal"&gt;fort()&lt;/tt&gt;. Here is a sample for the &lt;tt class="function"&gt;matset&lt;/tt&gt; function above.&lt;/p&gt;  &lt;pre class="programlisting"&gt;// Wrapper function for calling C language routine matset_c from SciLab&lt;br /&gt;&lt;br /&gt;function mat = matset(mat, row, col, val)&lt;br /&gt;m = size(mat);&lt;br /&gt;mat = fort("matset_c",&lt;br /&gt;         mat, 1, "d",&lt;br /&gt;         m(1, 1), 2, "i",&lt;br /&gt;         row, 3, "i",&lt;br /&gt;         col, 4, "i",&lt;br /&gt;         val, 5, "d",&lt;br /&gt;         "out",&lt;br /&gt;         m, 1, "d");&lt;br /&gt;endfunction&lt;br /&gt;   &lt;br /&gt;&lt;/pre&gt;  &lt;p&gt;  A sample &lt;span class="application"&gt;Scilab&lt;/span&gt; session is shown below:&lt;/p&gt;  &lt;pre class="screen"&gt;&lt;tt class="prompt"&gt;--&gt;&lt;/tt&gt;&lt;tt class="userinput"&gt;&lt;b&gt;link("d:\vc\sci\debug\sci.dll", "matset_c", "c")&lt;/b&gt;&lt;/tt&gt;&lt;br /&gt;Linking matset_c&lt;br /&gt;Link done&lt;br /&gt;ans  =&lt;br /&gt;  0.&lt;br /&gt;&lt;br /&gt;&lt;tt class="prompt"&gt;--&gt;&lt;/tt&gt;&lt;tt class="userinput"&gt;&lt;b&gt;getf('E:\scilab\source\ctest.sci');&lt;/b&gt;&lt;/tt&gt;&lt;br /&gt;&lt;tt class="prompt"&gt;--&gt;&lt;/tt&gt;&lt;tt class="userinput"&gt;&lt;b&gt;mat = zeros(5, 5);&lt;/b&gt;&lt;/tt&gt;&lt;br /&gt;&lt;tt class="prompt"&gt;--&gt;&lt;/tt&gt;&lt;tt class="userinput"&gt;&lt;b&gt;matset(mat, 3, 3, 16.71)&lt;/b&gt;&lt;/tt&gt;&lt;br /&gt;ans  =&lt;br /&gt;!   0.    0.    0.       0.    0. !&lt;br /&gt;!   0.    0.    0.       0.    0. !&lt;br /&gt;!   0.    0.    16.71    0.    0. !&lt;br /&gt;!   0.    0.    0.       0.    0. !&lt;br /&gt;!   0.    0.    0.       0.    0. !  &lt;br /&gt;   &lt;br /&gt;&lt;/pre&gt; &lt;/li&gt;&lt;/ol&gt; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1190391999863276012-9096405902713058201?l=lucacremascilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lucacremascilab.blogspot.com/feeds/9096405902713058201/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1190391999863276012&amp;postID=9096405902713058201' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1190391999863276012/posts/default/9096405902713058201'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1190391999863276012/posts/default/9096405902713058201'/><link rel='alternate' type='text/html' href='http://lucacremascilab.blogspot.com/2008/03/calling-of-cc-routines-from-windows.html' title='calling of C/C++ routines from the Windows™ version of Scilab using Microsoft™&apos;s Visual C++ compiler'/><author><name>luca_crema</name><uri>http://www.blogger.com/profile/11879780712331229042</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1190391999863276012.post-2022471101051029442</id><published>2008-03-02T14:14:00.000-08:00</published><updated>2008-03-02T14:15:52.999-08:00</updated><title type='text'>lanciare scilab in modo batch</title><content type='html'>&lt;div class="serendipity_entry_body"&gt;tratto da &lt;a href="http://philippe.matthieu.free.fr/serendipity/index.php?/archives/17-Scilab-Lancer-Scilab-en-mode-batch.html#extended"&gt;qui&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Bien des fois j'utilise Scilab pour effectuer des analyses en cours de journée, ou la nuit, quand je n'utilise pas mon PC.&lt;br /&gt;Voici une méthode simple pour éxécuter un script Scilab en mode automatique.&lt;br /&gt;&lt;br /&gt;             &lt;/div&gt;                          La commande est assez simple, il s'agit de coder un script Scilab qui effectue les appels aux fonctions utiles aux traitements.&lt;br /&gt;Le script Scilab est éxécuté avec l'option &lt;em&gt;No Windows (-nw)&lt;/em&gt; et par l'exécution du script (pas une fonction !), grâce à l'option &lt;em&gt;File (-f)&lt;/em&gt;.&lt;br /&gt;La commande pour lancer le script est donc la suivante sous Windows :&lt;br /&gt;&lt;span style="color:GRAY;"&gt; &lt;blockquote&gt;"C:\Program Files\scilab-4.1.1\bin\scilex" -nw -f MonScript.sce&lt;/blockquote&gt;&lt;/span&gt;Le script doit finir par la commande &lt;em&gt;quit&lt;/em&gt;.&lt;br /&gt;&lt;br /&gt;Prenons l'exemple d'un traitement mtriciel que nous souhaitons sauvegarder dans un fichier.&lt;br /&gt;Voici le script à exécuter (extrait de l'aide Write d'ailleur) &lt;img src="http://philippe.matthieu.free.fr/serendipity/templates/default/img/emoticons/smile.png" alt=":-)" style="display: inline; vertical-align: bottom;" class="emoticon" /&gt; :&lt;br /&gt;MonScript.sce :&lt;span style="color:GRAY;"&gt; &lt;blockquote&gt;A=rand(5,3);&lt;br /&gt;write(%io(2),A,'('' | '',3(f10.3,'' | ''))');&lt;br /&gt;if MSDOS then unix('del foo');&lt;br /&gt;else unix('rm -f foo'); end;&lt;br /&gt;write('foo',A)&lt;br /&gt;quit;&lt;/blockquote&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1190391999863276012-2022471101051029442?l=lucacremascilab.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lucacremascilab.blogspot.com/feeds/2022471101051029442/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1190391999863276012&amp;postID=2022471101051029442' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1190391999863276012/posts/default/2022471101051029442'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1190391999863276012/posts/default/2022471101051029442'/><link rel='alternate' type='text/html' href='http://lucacremascilab.blogspot.com/2008/03/lanciare-scilab-in-modo-batch.html' title='lanciare scilab in modo batch'/><author><name>luca_crema</name><uri>http://www.blogger.com/profile/11879780712331229042</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
