summaryrefslogtreecommitdiffstats
path: root/scilab_doc
diff options
context:
space:
mode:
authorPierre Marechal <pierre.marechal@scilab.org>2006-06-23 08:39:44 +0000
committerPierre Marechal <pierre.marechal@scilab.org>2006-06-23 08:39:44 +0000
commitfec7ba029aed42db16719336ab7cbb39d9c22a08 (patch)
tree0fcca755c283d6a2c2dd3d852a761e3fee53500a /scilab_doc
parentfbb1ca1da29a5e50c90a292a98bfe16e78acf820 (diff)
downloadscilab-fec7ba029aed42db16719336ab7cbb39d9c22a08.zip
scilab-fec7ba029aed42db16719336ab7cbb39d9c22a08.tar.gz
Add the Matlab-Scilab dictionnary
Diffstat (limited to 'scilab_doc')
-rwxr-xr-xscilab_doc/Dictionnaire-Matlab-Scilab/.memdump4
-rw-r--r--scilab_doc/Dictionnaire-Matlab-Scilab/Makefile31
-rw-r--r--scilab_doc/Dictionnaire-Matlab-Scilab/makedoc.sce1017
-rw-r--r--scilab_doc/Dictionnaire-Matlab-Scilab/matscifuns.xml3598
4 files changed, 4650 insertions, 0 deletions
diff --git a/scilab_doc/Dictionnaire-Matlab-Scilab/.memdump b/scilab_doc/Dictionnaire-Matlab-Scilab/.memdump
new file mode 100755
index 0000000..38df225
--- /dev/null
+++ b/scilab_doc/Dictionnaire-Matlab-Scilab/.memdump
@@ -0,0 +1,4 @@
1 06:17:41 PM
2
3 MEMORY ALLOCATED : 0, MAX was 0
4BLOCK NUMBER SIZE TYPE
diff --git a/scilab_doc/Dictionnaire-Matlab-Scilab/Makefile b/scilab_doc/Dictionnaire-Matlab-Scilab/Makefile
new file mode 100644
index 0000000..79c990c
--- /dev/null
+++ b/scilab_doc/Dictionnaire-Matlab-Scilab/Makefile
@@ -0,0 +1,31 @@
1LATEX = latex
2
3RM = rm
4
5PDFLATEX = pdflatex
6
7MAKEINDEX = makeindex
8
9doc :
10 echo "Generating HTML and TEX files..."
11 echo "exec('makedoc.sce');quit;" | scilab -nw
12 echo "Compiling TEX files..."
13 $(LATEX) M2SCI.tex
14 $(PDFLATEX) M2SCI.tex
15 $(LATEX) SCI2M.tex
16 $(PDFLATEX) SCI2M.tex
17 echo "Generating TEX index files..."
18 $(MAKEINDEX) M2SCI.idx
19 $(MAKEINDEX) SCI2M.idx
20 echo "Re-Compiling TEX files..."
21 $(LATEX) M2SCI.tex
22 $(PDFLATEX) M2SCI.tex
23 $(LATEX) SCI2M.tex
24 $(PDFLATEX) SCI2M.tex
25
26clean :
27 $(RM) -f M2SCI.*
28 $(RM) -f SCI2M.*
29 $(RM) -f ./html/M2SCI.htm
30 $(RM) -f ./html/SCI2M.htm
31 $(RM) -f ./html/*_index.htm \ No newline at end of file
diff --git a/scilab_doc/Dictionnaire-Matlab-Scilab/makedoc.sce b/scilab_doc/Dictionnaire-Matlab-Scilab/makedoc.sce
new file mode 100644
index 0000000..698b91c
--- /dev/null
+++ b/scilab_doc/Dictionnaire-Matlab-Scilab/makedoc.sce
@@ -0,0 +1,1017 @@
1mode(-1);
2// Copyright INRIA
3
4// Contents of this file
5// - function []=xml2htmlpdf(XMLFILE,dic)
6// - function [MATNAME,DESCR,SCINAME,NOTE,MATEX,SCIEX]=get_func_info(data,index)
7// - function []=write_html_data(matname,descr,sciname,note,matex,sciex,funnb,dic)
8// - function []=write_latex_data(matname,descr,sciname,note,matex,sciex,funnb,dic)
9// - function [matname,descr,sciname,note,matex,sciex]=datatohtml(matname,descr,sciname,note,matex,sciex)
10// - function [matname,descr,sciname,note,matex,sciex]=datatolatex(matname,descr,sciname,note,matex,sciex)
11// - function []=create_html_index(indexfile,names,dic)
12// - function [out]=special_name(in)
13// - function [entry]=index_entry(in)
14// - Some batch instructions
15
16//****************************************************************************************
17// function []=xml2htmlpdf(XMLFILE,dic)
18// Copyright INRIA
19// XMLFILE : XML file containing data to convert
20// dic : dictionary we want to build (M2SCI or SCI2M)
21//****************************************************************************************
22function []=xml2htmlpdf(XMLFILE,dic)
23LATEXFILE=dic+".tex"
24HTMLFILE="./html/"+dic+".htm"
25HTMLINDEXFILE="./html/"+dic+"_index.htm"
26
27// Verify that XML file is well formed
28//ierr=execstr("unix_s(""xmllint --noout --valid "+XMLFILE+""")","errcatch")
29//if ierr<>0 then
30 //mprintf("File : "+XMLFILE+" does not follow DTD");
31 //return
32//end
33
34// Read data in XML file
35[xmlfile,ierr]=mopen(XMLFILE,"r")
36if ierr<>0 then
37 mprintf("Could not open file : "+XMLFILE);
38 return
39end
40xmldata=mgetl(xmlfile);
41mclose(xmlfile);
42
43// Create function table
44funtable=[] // line matname sciname
45k=1
46while k<size(xmldata,1)
47 while strindex(xmldata(k),"<MATSCIFUN>")==[] & k<size(xmldata,1)
48 k=k+1
49 end
50 tmp=string(k)
51 while strindex(xmldata(k),"<MATNAME>")==[] & k<size(xmldata,1)
52 k=k+1
53 end
54 tmp=[tmp,stripblanks(strsubst(strsubst(xmldata(k),"<MATNAME>",""),"</MATNAME>",""))]
55 while strindex(xmldata(k),"<SCINAME>")==[] & k<size(xmldata,1)
56 k=k+1
57 end
58 tmp=[tmp,stripblanks(strsubst(strsubst(xmldata(k),"<SCINAME>",""),"</SCINAME>",""))]
59 if k<size(xmldata,1) then
60 funtable=[funtable;tmp]
61 end
62end
63
64// Parameter initialization according to dic
65if dic=="M2SCI" then
66 title="Matlab-Scilab equivalent functions"
67 leftimage="<B>Matlab</B>"
68 rightimage="<IMG SRC=scilab.gif>"
69 lefthead="Matlab function"
70 righthead="Scilab function"
71
72 // Del No equivalent funnames
73 k=1
74 while k<=size(funtable,1)
75 if funtable(k,2)=="No equivalent" then
76 functable(k,:)=[]
77 else
78 funtable(k,4)=special_name(funtable(k,2)) // Name in index
79 funtable(k,5)=index_entry(funtable(k,2)) // Entry in index
80 k=k+1
81 end
82 end
83
84 [tmp,indexes]=sort(convstr(funtable(:,2)))
85
86 funlines=[];funnames=[];indexnames=[];indexentries=[]
87 oplines=[];opnames=[];
88 varlines=[];varnames=[];
89 for k=1:size(indexes,1)
90 if length(funtable(indexes(k),5))==1 then
91 funlines=[funlines;funtable(indexes(k),1)] // Line in XML file
92 funnames=[funnames;funtable(indexes(k),2)] // Name of function
93 indexnames=[indexnames;funtable(indexes(k),4)] // Name in index
94 indexentries=[indexentries;funtable(indexes(k),5)] // Entry in index
95 elseif funtable(indexes(k),5)=="Operators" then
96 oplines=[oplines;funtable(indexes(k),1)];
97 opnames=[opnames;funtable(indexes(k),2)];
98 elseif funtable(indexes(k),5)=="Variables" then
99 varlines=[varlines;funtable(indexes(k),1)];
100 varnames=[varnames;funtable(indexes(k),2)];
101 else
102 error("Wrong index entry : "+funtable(indexes(k),5));
103 end
104 end
105
106 // Add operators
107 for k=1:size(opnames,1)
108 funlines=[funlines;oplines(k)]
109 funnames=[funnames;opnames(k)]
110 indexnames=[indexnames;special_name(opnames(k))]
111 indexentries=[indexentries;"Operators"]
112 end
113
114 // Add Variables
115 for k=1:size(varnames,1)
116 funlines=[funlines;varlines(k)]
117 funnames=[funnames;varnames(k)]
118 indexnames=[indexnames;special_name(varnames(k))]
119 indexentries=[indexentries;"Variables"]
120 end
121else
122 title="Scilab-Matlab equivalent functions"
123 leftimage="<IMG SRC=scilab.gif>"
124 rightimage="<B>Matlab</B>"
125 lefthead="Scilab function"
126 righthead="Matlab function"
127
128 // Del No equivalent funnames
129 k=1
130 while k<=size(funtable,1)
131 write(%io(2),funtable(k,3))
132 if funtable(k,3)=="No equivalent" then
133 funtable(k,:)=[]
134 elseif part(stripblanks(funtable(k,3)),1)=="1" then
135 funtable(k,:)=[]
136 else
137 funtable(k,4)=special_name(funtable(k,3)) // Name in index
138 funtable(k,5)=index_entry(funtable(k,3)) // Entry in index
139 k=k+1
140 end
141 end
142
143 [tmp,indexes]=sort(convstr(funtable(:,3)))
144
145 funlines=[];funnames=[];indexnames=[];indexentries=[]
146 oplines=[];opnames=[];
147 varlines=[];varnames=[];
148 for k=1:size(indexes,1)
149 if length(funtable(indexes(k),5))==1 then
150 funlines=[funlines;funtable(indexes(k),1)] // Line in XML file
151 funnames=[funnames;funtable(indexes(k),3)] // Name of function
152 indexnames=[indexnames;funtable(indexes(k),4)] // Name in index
153 indexentries=[indexentries;funtable(indexes(k),5)] // Entry in index
154 elseif funtable(indexes(k),5)=="Operators" then
155 oplines=[oplines;funtable(indexes(k),1)];
156 opnames=[opnames;funtable(indexes(k),3)];
157 elseif funtable(indexes(k),5)=="Variables" then
158 varlines=[varlines;funtable(indexes(k),1)];
159 varnames=[varnames;funtable(indexes(k),3)];
160 else
161 error("Wrong index entry : "+funtable(indexes(k),5));
162 end
163 end
164
165 // Add operators
166 for k=1:size(opnames,1)
167 funlines=[funlines;oplines(k)]
168 funnames=[funnames;opnames(k)]
169 indexnames=[indexnames;special_name(opnames(k))]
170 indexentries=[indexentries;"Operators"]
171 end
172
173 // Add Variables
174 for k=1:size(varnames,1)
175 funlines=[funlines;varlines(k)]
176 funnames=[funnames;varnames(k)]
177 indexnames=[indexnames;special_name(varnames(k))]
178 indexentries=[indexentries;"Variables"]
179 end
180end
181
182if dic=="M2SCI" then
183 ref="Matlab"
184 eq="Scilab"
185else
186 eq="Matlab"
187 ref="Scilab"
188end
189
190LATEX_FORWORD=[
191 "This document contains a list of some "+ref+" basis functions and compare them ";
192 "with the "+eq+" equivalent functions if there are. It gives the main differences ";
193 "and gives examples of particular cases.\newline";
194 "\newline"
195 "However not all "+ref+" and "+eq+" functions are described here.\newline";
196 "\newline"
197 "Equivalents for operators and variables can be found at the end of this document.\newline"
198 "\newline"
199 "Caution:\newline"
200 "This document is not dedicated to explain how functions work. ";
201 "Users can used online manuals of "+ref+" and "+eq+" for it.\newline"
202 "\newline"
203 ]
204HTML_FOREWORD=[
205 LATEX_FORWORD;
206 "How to use this HTML guide:\newline";
207 "To have more details about functions and examples, clic on the ""triangles"" just ";
208 "at the left of "+ref+" function name.\newline";
209 "To have a more detailed index, clic on the letters and keywords.\newline"
210 ]
211
212// Write HTML file beginning
213HTML_FILE_BEG=[
214 "<!-- FILE GENERATED BY SCILAB - PLEASE DO NOT EDIT -->"
215 "<HTML>"
216 "<HEAD>"
217 " <TITLE>"+title+"</title>"
218 " <META HTTP-EQUIV=""Content-Type"" CONTENT=""text/html; charset=iso-8859-1"">"
219 " <SCRIPT SRC=""matsci.js""></SCRIPT>"
220 "</HEAD>"
221 "<BODY BACKGROUND=""back.jpg"">"
222 "<P ALIGN=""center"">"
223 "<FONT FACE=""arial"">"
224 ]
225[htmlfile,ierr]=mopen(HTMLFILE,"w")
226if ierr<>0 then
227 mprintf("Could not open file : "+HTMLFILE);
228 return
229end
230mputl([HTML_FILE_BEG;
231 "<A NAME=""Foreword""></A>"
232 "<TABLE WIDTH=""80%"">";
233 " <TR WIDTH=""100%"">"
234 " <TD COLSPAN=""4"" ALIGN=""center"">"
235 " <FONT SIZE=""+2"" COLOR=""red"">Foreword</FONT>"
236 " <HR WIDTH=""100%"">"
237 " </TD>"
238 " </TR>"
239 " <TR WIDTH=""100%"">"
240 " <TD COLSPAN=""4"">"
241 strsubst(HTML_FOREWORD,"\newline","<BR>")
242 " </TD>"
243 " </TR>"
244 "</TABLE>"
245 ],htmlfile)
246mclose(htmlfile)
247
248// Write LATEX file beginning
249LATEX_FILE_BEG=[
250 "% FILE GENERATED BY SCILAB - PLEASE DO NOT EDIT %"
251 "\documentclass[12pt]{report}"
252 "\usepackage[a4paper,text={170mm,250mm},pdftex,twoside]{geometry}"
253 "\usepackage{fancyheadings}"
254 "\lhead{"+lefthead+"}"
255 "\rhead{"+righthead+"}"
256 "\cfoot{DRAFT - Page {\thepage}}"
257 "\addtolength{\parskip}{5mm}"
258 "\usepackage{makeidx}"
259 "\makeindex"
260 "\usepackage{amssymb}"
261 "\usepackage{hyperref}"
262 "\begin{document}"
263 "\pagestyle{empty}"
264 "\begin{center}"
265 "\vspace*{9cm}"
266 "\begin{minipage}[c]{\linewidth}"
267 "\begin{center}"
268 "\textbf{\Large{"+dic+":\\"+title+"\\}}"
269 "Version 1.0"
270 "\end{center}"
271 "\begin{center}"
272 "Scilab Project\\"
273 "INRIA Rocquencourt - BP 105\\"
274 "78153 Le Chesnay Cedex - France\\"
275 "Email: \texttt{scilab@inria.fr}\\"
276 "2004"
277 "\end{center}"
278 "\end{minipage}"
279 "\end{center}"
280 "\cleardoublepage"
281 "\newpage"
282 "\pdfbookmark[0]{Foreword}{Forword}"
283 "\begin{center}"
284 "\textbf{Forword}"
285 "\end{center}"
286 LATEX_FORWORD
287 "\cleardoublepage"
288 "\printindex"
289 "\cleardoublepage"
290 "\pagestyle{fancy}"
291 ]
292[latexfile,ierr]=mopen(LATEXFILE,"w")
293if ierr<>0 then
294 mprintf("Could not open file : "+LATEXFILE);
295 return
296end
297mputl(LATEX_FILE_BEG,latexfile)
298mclose(latexfile)
299
300// Write all function informations
301indentry_sav=""
302for l=1:size(funnames,1)
303
304 // Get infos from xml data
305 [matname,descr,sciname,note,matex,sciex]=get_func_info(xmldata,evstr(funlines(l)))
306
307 // Add indexes to files (HTML and TEX)
308 indentry=indexentries(l)
309 if indentry<>indentry_sav then
310
311 // Index HTML file (A, B, ...)
312 HTML_DATA=[
313 "<A NAME="""+indentry+"""></A>";
314 "<TABLE WIDTH=""80%"">";
315 " <TR WIDTH=""100%"">"
316 " <TD COLSPAN=""4"">"
317 " <HR WIDTH=""100%"">"
318 " </TD>"
319 " </TR>"
320 " <TR WIDTH=""100%"">";
321 " <TD HEIGHT=""20"" WIDTH=""100%"" COLSPAN=""4"">";
322 " </TD>";
323 " </TR>";
324 " <TR WIDTH=""100%"">";
325 " <TD WIDTH=""5%"" ALIGN=""center""></TD>";
326 " <TD WIDTH=""10%"" ALIGN=""center"">"+leftimage+"</TD>";
327 " <TD WIDTH=""70%"" ALIGN=""center""><FONT SIZE=""+2"" COLOR=""red"">"+indentry+"</FONT></TD>";
328 " <TD WIDTH=""10%"" ALIGN=""center"">"+rightimage+"</TD>";
329 " </TR>";
330 "</TABLE>"]
331
332 [htmlfile,ierr]=mopen(HTMLFILE,"a+")
333 if ierr<>0 then
334 mprintf("Could not open file : "+HTMLFILE);
335 return
336 end
337 mputl(HTML_DATA,htmlfile)
338 mclose(htmlfile)
339
340 // Index LATEX file (A, B, ...)
341 LATEX_DATA=[
342 "\newpage"
343 "\pdfbookmark[0]{"+indentry+"}{"+indentry+"}"
344 "\begin{center}\textbf{"+indentry+"}\end{center}"
345 ]
346 [latexfile,ierr]=mopen(LATEXFILE,"a+")
347 if ierr<>0 then
348 mprintf("Could not open file : "+LATEXFILE);
349 return
350 end
351 mputl(LATEX_DATA,latexfile)
352 mclose(latexfile)
353
354 indentry_sav=indentry
355 end
356
357 // Write data according to data read
358 write_html_data(matname,descr,sciname,note,matex,sciex,l,dic);
359 write_latex_data(matname,descr,sciname,note,matex,sciex,l,dic,indexnames(l),indexentries(l));
360end
361
362// Write HTML file end
363HTML_FILE_END=[
364 "</P>"
365 "</FONT>"
366 "</BODY>"
367 "</HTML>"
368 ]
369[htmlfile,ierr]=mopen(HTMLFILE,"a+")
370if ierr<>0 then
371 mprintf("Could not open file : "+HTMLFILE);
372 return
373end
374mputl(["<HR WIDTH=""80%"">";HTML_FILE_END],htmlfile)
375mclose(htmlfile)
376
377// Write LATEX file end
378LATEX_FILE_END=[
379 "\end{document}"
380 ]
381[latexfile,ierr]=mopen(LATEXFILE,"a+")
382if ierr<>0 then
383 mprintf("Could not open file : "+LATEXFILE);
384 return
385end
386mputl(LATEX_FILE_END,latexfile)
387mclose(latexfile)
388
389// Create HTML index file (done automatically for TEX)
390create_html_index(HTMLINDEXFILE,funnames,dic,indexentries)
391endfunction
392
393
394//****************************************************************************************
395//function [MATNAME,DESCR,SCINAME,NOTE,MATEX,SCIEX]=get_func_info(data,index)
396// Copyright INRIA
397// data : XML data
398// index : position of function in data
399//****************************************************************************************
400function [MATNAME,DESCR,SCINAME,NOTE,MATEX,SCIEX]=get_func_info(data,index)
401index=index+1
402MATNAME=stripblanks(strsubst(strsubst(data(index),"<MATNAME>",""),"</MATNAME>",""))
403index=index+1
404SCINAME=stripblanks(strsubst(strsubst(data(index),"<SCINAME>",""),"</SCINAME>",""))
405index=index+1
406DESCR=stripblanks(strsubst(strsubst(data(index),"<DESCR>",""),"</DESCR>",""))
407index=index+1
408disp(data(index-3))
409if strindex(data(index),"</MATSCIFUN>")==[] then
410 index=index+1
411 NOTE=""
412 while strindex(data(index),"</NOTE>")==[]
413 NOTE=NOTE+stripblanks(data(index))
414 index=index+1
415 end
416 index=index+1
417 if strindex(data(index),"</MATSCIFUN>")==[] then
418
419 if strindex(data(index),"<MATEX>")<>[] then
420 index=index+1
421 MATEX=[]
422 while strindex(data(index),"</MATEX>")==[] then
423 MATEX=[MATEX;stripblanks(data(index))]
424 index=index+1
425 end
426 index=index+1
427 end
428
429 if strindex(data(index),"<SCIEX>")<>[] then
430 index=index+1
431 SCIEX=[]
432 while strindex(data(index),"</SCIEX>")==[] then
433 SCIEX=[SCIEX;stripblanks(data(index))]
434 index=index+1
435 end
436 end
437 else
438 MATEX=""
439 SCIEX=""
440 end
441else
442 NOTE=""
443 MATEX=""
444 SCIEX=""
445end
446endfunction
447
448//****************************************************************************************
449//function []=write_html_data(matname,descr,sciname,note,matex,sciex,funnb,dic)
450// Copyright INRIA
451//****************************************************************************************
452function []=write_html_data(matname,descr,sciname,note,matex,sciex,funnb,dic)
453[matname,descr,sciname,note,matex,sciex]=datatohtml(matname,descr,sciname,note,matex,sciex)
454
455if dic=="M2SCI" then
456 leftname=matname
457 rightname=sciname
458 leftex=matex
459 rightex=sciex
460else
461 leftname=sciname
462 rightname=matname
463 leftex=sciex
464 rightex=matex
465end
466
467[htmlfile,ierr]=mopen(HTMLFILE,"a+")
468if ierr<>0 then
469 mprintf("Could not open file : "+HTMLFILE);
470 return
471end
472
473// Prepare data to write in HTML file
474ind_name=strsubst(special_name(leftname)," ","-")
475ind_name=strsubst(ind_name,"&#8596;","")
476
477HTML_DATA = [
478 "<!---------- "+special_name(leftname)+" ---------->"
479 "<A NAME="""+ind_name+"""></A>";
480 "<TABLE CELLPADING=""0"" CELLSPACING=""0"" WIDTH=""80%"">";
481 " <TR>"
482 " <TD>"
483 " <HR WIDTH=""100%"">"
484 " </TD>"
485 " </TR>"
486 " <TR WIDTH=""100%""> "
487 " <TD>"
488 " <TABLE WIDTH=""100%"" CELLSPACING=""0"">"
489 " <TR>"
490 " <TD WIDTH=""5%"" ALIGN=""right"" VALIGN=""top"">"
491 ]
492if or(leftex<>"") | or(rightex<>"") | or(note<>"") then
493 HTML_DATA=[
494 HTML_DATA;
495 " <A HREF=""javascript:swap_couche(''"+string(funnb)+"'');"">"
496 " <IMG NAME=""arrow"+string(funnb)+""" SRC=""rightarrow.gif?1"" BORDER=""0"">"
497 " </A>"
498 ]
499end
500HTML_DATA=[
501 HTML_DATA;
502 " </TD>"
503 " <TD WIDTH=""10%"" ALIGN=""center""><B>"+leftname+"</B></TD>"
504 " <TD WIDTH=""75%"" ALIGN=""center""><I>"+descr+"</I></TD>"
505 " <TD WIDTH=""10%"" ALIGN=""center""><B>"+rightname+"</B></TD>"
506 " </TR>"
507 " </TABLE>"
508 " </TD>"
509 " </TR>"]
510if or(leftex<>"") | or(rightex<>"") | or(note<>"") then
511 HTML_DATA=[
512 HTML_DATA;
513 " <SCRIPT LANGUAGE=''JavaScript''>"
514 " <!-- "
515 " vis[''"+string(funnb)+"''] = ''hide'';"
516 " //-->"
517 " </SCRIPT>"
518 " <TR WIDTH=""100%"">"
519 " <TD>"
520 " <DIV ID=''Layer"+string(funnb)+"'' STYLE=''display: none;''>"
521 " <TABLE WIDTH=""100%"" CELLSPACING=""0"" BORDER=""1"" BORDERCOLOR=""silver"">"
522 ]
523 if or(note<>"") then
524 HTML_DATA=[
525 HTML_DATA
526 " <TR>"
527 " <TD COLSPAN=""2"">"+note+"</TD>"
528 " </TR>"
529 ]
530 end
531 if or(rightex<>"") | or(leftex<>"") then
532 if leftex=="" then leftex="None";end
533 if rightex=="" then rightex="None";end
534 HTML_DATA=[
535 HTML_DATA
536 " <TR>"
537 " <TD VALIGN=""top"" WIDTH=""50%""><TT>"+leftex+"</TT></td>"
538 " <TD VALIGN=""top"" WIDTH=""50%""><TT>"+rightex+"</TT></td>"
539 " </TR>"
540 ]
541
542 end
543 HTML_DATA=[
544 HTML_DATA
545 " </TABLE>"
546 " <BR>"
547 " </DIV>"
548 " </TD>"
549 " </TR>"
550 ]
551end
552
553HTML_DATA=[
554 HTML_DATA
555 "</TABLE>"
556 ]
557
558mputl(HTML_DATA,htmlfile)
559mclose(htmlfile)
560endfunction
561
562//****************************************************************************************
563// function [matname,descr,sciname,note,matex,sciex]=datatohtml(matname,descr,sciname,note,matex,sciex)
564// Copyright INRIA
565// Convert XML data to HTML
566//****************************************************************************************
567function [matname,descr,sciname,note,matex,sciex]=datatohtml(matname,descr,sciname,note,matex,sciex)
568
569// Syntax modification
570matname=strsubst(matname,"<MATH>","")
571matname=strsubst(matname,"</MATH>","")
572matname=strsubst(matname,"|-|","&#8596;")
573
574sciname=strsubst(sciname,"<MATH>","")
575sciname=strsubst(sciname,"</MATH>","")
576sciname=strsubst(sciname,"|-|","&#8596;")
577
578note=strsubst(note,"<P>","")
579note=strsubst(note,"</P>","<BR>")
580note=strsubst(note,"<B>","<B>")
581note=strsubst(note,"<MATH>","")
582note=strsubst(note,"</MATH>","")
583note=strsubst(note,"|-|","&#8596;")
584
585note=strsubst(note,"</NOTE_ITEM>","")
586kitem=strindex(note,"<NOTE_ITEM")
587kitem=[kitem,length(note)+1]
588klabel=strindex(note,"LABEL")
589kend=strindex(note,""">")
590if kitem<>[] then
591 tmp=part(note,1:kitem(1)-1)
592 for m=1:size(kitem,"*")-1
593 label=strsubst(part(note,klabel(m)+7:kend(m)-1),"|-|","&#8596;")
594 tmp=tmp+"&#9657; "+label+":<BR>"+part(note,kend(m)+2:kitem(m+1)-1)+"<BR>"
595 end
596 note=stripblanks(tmp)
597end
598
599// Remove useless newline
600if max(strindex(note,"<BR>"))==length(note)-3 then
601 note=part(note,1:(length(note)-4))
602end
603
604if matex<>"" then
605 tmp="<TT>"
606 for m=1:size(matex,1)
607 matex(m)=strsubst(matex(m),"<MATH>","")
608 matex(m)=strsubst(matex(m),"</MATH>","")
609 tmp=tmp+matex(m)+"<BR>"
610 end
611 tmp=tmp+"</TT>"
612 matex=tmp
613end
614
615if sciex<>"" then
616 tmp="<TT>"
617 for m=1:size(sciex,1)
618 tmp=tmp+sciex(m)+"<BR>"
619 end
620 tmp=tmp+"</TT>"
621 sciex=tmp
622end
623
624rhs=argn(2)
625if rhs<3 then
626 note=""
627end
628if rhs<4 then
629 matex=""
630end
631if rhs<5 then
632 sciex=""
633end
634
635endfunction
636
637//****************************************************************************************
638//function []=write_latex_data(matname,descr,sciname,note,matex,sciex,funnb,dic)
639// Copyright INRIA
640//****************************************************************************************
641function []=write_latex_data(matname,descr,sciname,note,matex,sciex,funnb,dic,index_name,index_entry)
642[matname,descr,sciname,note,matex,sciex]=datatolatex(matname,descr,sciname,note,matex,sciex)
643
644if dic=="M2SCI" then
645 leftname=matname
646 rightname=sciname
647 leftex=matex
648 rightex=sciex
649else
650 leftname=sciname
651 rightname=matname
652 leftex=sciex
653 rightex=matex
654end
655
656[latexfile,ierr]=mopen(LATEXFILE,"a+")
657if ierr<>0 then
658 mprintf("Could not open file : "+LATEXFILE);
659 return
660end
661
662// Prepare data to write in LATEX file
663ind_name=strsubst(special_name(leftname)," ","-")
664ind_name=strsubst(ind_name,"$\Leftrightarrow$","")
665
666LATEX_DATA = [
667 "%---------- "+ind_name+" ----------"
668 "\pdfbookmark[1]{"+leftname+"}{"+index_name+"}"
669 ]
670
671if index_entry=="Operators" then
672 LATEX_DATA = [
673 LATEX_DATA;
674 "\index{"+index_entry+"!"+index_name+"\textsf{("+leftname+")}}"
675 ]
676elseif index_entry=="Variables" & index_name=="Last index" then
677 LATEX_DATA = [
678 LATEX_DATA;
679 "\index{"+index_entry+"!"+index_name+"\textsf{(end)}}"
680 ]
681else
682 LATEX_DATA = [
683 LATEX_DATA;
684 "\index{"+index_entry+"!"+index_name+"}"
685 ]
686end
687
688LATEX_DATA = [
689 LATEX_DATA;
690 "\begin{center}"
691 "\begin{tabular}{|p{4.5cm}|p{3.25cm}p{3.25cm}|p{4.5cm}|}"
692 "\hline\multicolumn{1}{|p{4.5cm}}{\centering\textbf{"+leftname+"}} & "
693 "\multicolumn{2}{|p{6.5cm}|}{\centering\textit{"+descr+"}} & "
694 "\multicolumn{1}{p{4.5cm}|}{\centering\textbf{"+rightname+"}} \\ \hline"
695 ]
696if note<>"" then
697 LATEX_DATA=[
698 LATEX_DATA
699 "\multicolumn{4}{|p{16.5cm}|}{"+note+"} \\ \hline"
700 ]
701end
702
703if or(rightex<>"") | or(leftex<>"") then
704 if leftex=="" then leftex="None";end
705 if rightex=="" then rightex="None";end
706 LATEX_DATA=[
707 LATEX_DATA
708 "\multicolumn{2}{|p{7.75cm}|}{"+leftex+"} & "
709 "\multicolumn{2}{p{7.75cm}|}{"+rightex+"} \\ \hline"
710 ]
711end
712
713LATEX_DATA=[
714 LATEX_DATA
715 "\end{tabular}"
716 "\end{center}"
717 ]
718
719mputl(LATEX_DATA,latexfile)
720mclose(latexfile)
721endfunction
722
723//****************************************************************************************
724// function [matname,descr,sciname,note,matex,sciex]=datatolatex(matname,descr,sciname,note,matex,sciex)
725// Copyright INRIA
726// Convert XML data to LATEX
727//****************************************************************************************
728function [matname,descr,sciname,note,matex,sciex]=datatolatex(matname,descr,sciname,note,matex,sciex)
729
730matname=strsubst(matname,"\","\textbackslash");
731matname=strsubst(matname,"<MATH>^</MATH>","\textasciicircum")
732matname=strsubst(matname,"%","\%")
733matname=strsubst(matname,"$","\$")
734matname=strsubst(matname,"&amp;","\&")
735matname=strsubst(matname,"&lt;","<")
736matname=strsubst(matname,"&gt;",">")
737matname=strsubst(matname,"<MATH>","$")
738matname=strsubst(matname,"</MATH>","$")
739matname=strsubst(matname,"|-|","$\Leftrightarrow$")
740matname=strsubst(matname,"_","\_")
741
742sciname=strsubst(sciname,"\","\textbackslash");
743sciname=strsubst(sciname,"<MATH>^</MATH>","\textasciicircum")
744sciname=strsubst(sciname,"%","\%")
745sciname=strsubst(sciname,"$","\$")
746sciname=strsubst(sciname,"&amp;","\&")
747sciname=strsubst(sciname,"&lt;","<")
748sciname=strsubst(sciname,"&gt;",">")
749sciname=strsubst(sciname,"<MATH>","$")
750sciname=strsubst(sciname,"</MATH>","$")
751sciname=strsubst(sciname,"|-|","$\Leftrightarrow$")
752sciname=strsubst(sciname,"_","\_")
753
754note=strsubst(note,"\","\textbackslash")
755note=strsubst(note,"$","\$")
756note=strsubst(note,"<P>","")
757note=strsubst(note,"</P>","\newline ")
758note=strsubst(note,"<B>","\textbf{")
759note=strsubst(note,"</B>","}")
760note=strsubst(note,"<MATH>^</MATH>","\textasciicircum")
761note=strsubst(note,"<MATH>","$")
762note=strsubst(note,"</MATH>","$")
763note=strsubst(note,"</NOTE_ITEM>","")
764note=strsubst(note,"&lt;","<")
765note=strsubst(note,"&gt;",">")
766note=strsubst(note,"%","\%")
767note=strsubst(note,"|-|","$\Leftrightarrow$")
768
769kitem=strindex(note,"<NOTE_ITEM")
770kitem=[kitem,length(note)+1]
771klabel=strindex(note,"LABEL")
772kend=strindex(note,""">")
773if kitem<>[] then
774 tmp=part(note,1:kitem(1)-1)
775 for m=1:size(kitem,"*")-1
776 label=strsubst(part(note,klabel(m)+7:kend(m)-1),"|-|","$\Leftrightarrow$")
777 tmp=tmp+"$\triangleright$ "+label+":\newline "+part(note,kend(m)+2:kitem(m+1)-1)+"\newline "
778 end
779 note=tmp
780 note=stripblanks(strsubst(note,"_","\_"))
781end
782
783// Remove useless newline
784if max(strindex(note,"\newline"))==length(note)-7 then
785 note=part(note,1:(length(note)-8))
786end
787
788if or(matex<>"") then
789 tmp="\texttt{"
790 for m=1:size(matex,1)
791 matex(m)=strsubst(matex(m),"&amp;","\&")
792 matex(m)=strsubst(matex(m),"&lt;","<")
793 matex(m)=strsubst(matex(m),"&gt;",">")
794 matex(m)=strsubst(matex(m),"^","\textasciicircum")
795 matex(m)=strsubst(matex(m),"_","\_")
796 matex(m)=strsubst(matex(m),"$","\$")
797 matex(m)=strsubst(matex(m),"<MATH>","$")
798 matex(m)=strsubst(matex(m),"</MATH>","$")
799 tmp=tmp+matex(m)
800 if m<>size(matex,1) then
801 tmp=tmp+"\newline "
802 end
803 end
804 tmp=tmp+"}"
805 matex=tmp
806end
807
808if or(sciex<>"") then
809 tmp="\texttt{"
810 for m=1:size(sciex,1)
811 sciex(m)=strsubst(sciex(m),"&amp;","\&")
812 sciex(m)=strsubst(sciex(m),"&lt;","<")
813 sciex(m)=strsubst(sciex(m),"&gt;",">")
814 sciex(m)=strsubst(sciex(m),"^","\textasciicircum")
815 sciex(m)=strsubst(sciex(m),"_","\_")
816 sciex(m)=strsubst(sciex(m),"%","\%")
817 sciex(m)=strsubst(sciex(m),"$","\$")
818 sciex(m)=strsubst(sciex(m),"<MATH>","$")
819 sciex(m)=strsubst(sciex(m),"</MATH>","$")
820 tmp=tmp+sciex(m)
821 if m<>size(sciex,1) then
822 tmp=tmp+"\newline "
823 end
824 end
825 tmp=tmp+"}"
826 sciex=tmp
827end
828
829rhs=argn(2)
830if rhs<3 then
831 note=""
832end
833if rhs<4 then
834 matex=""
835end
836if rhs<5 then
837 sciex=""
838end
839
840endfunction
841
842//****************************************************************************************
843// function []=create_html_index(indexfile,names,dic)
844// Copyright INRIA
845// - indexfile: name of file to create
846// - names: function names
847// - dic: dic to create
848//****************************************************************************************
849function []=create_html_index(indexfile,names,dic,indentries)
850
851htmlfile=mopen(indexfile,"w")
852
853mputl(HTML_FILE_BEG,htmlfile)
854
855firstlettersav=""
856for kname=1:size(names,"*")
857
858 firstletter=indentries(kname)
859 if length(firstletter)==1 then
860 couche=string(ascii(firstletter))
861 elseif firstletter=="Operators" then
862 couche=string(1000)
863 else
864 couche=string(1001)
865 end
866 if firstletter<>firstlettersav then
867 firstlettersav=firstletter
868 if kname<>1 then
869 HTML_DATA=[
870 " </DIV>"
871 " </TD>"
872 " </TR>"
873 "</TABLE>"
874 ]
875 else
876 if dic=="M2SCI" then
877 HTML_DATA="<A HREF=""SCI2M_doc.htm"" TARGET=""_top"">Go to SCI2M</A><BR>"
878 else
879 HTML_DATA="<A HREF=""M2SCI_doc.htm"" TARGET=""_top"">Go to M2SCI</A><BR>"
880 end
881 HTML_DATA=[
882 HTML_DATA
883 "<BR><A HREF="""+dic+".htm#Foreword"" TARGET=""dic"">Foreword</A><BR><BR>"
884 ]
885 end
886 HTML_DATA = [
887 HTML_DATA;
888 "<TABLE WIDTH=""70"">"
889 " <TR>"
890 " <TD>"
891 " <A HREF=""javascript:void(0)"" onClick=""javascript:swap_couche(''"+couche+"''); parent.dic.document.location.href = ''"+dic+".htm#"+firstletter+"''"">"+firstletter+"</A><BR>"
892 " </TD>"
893 " </TR>"
894 " <SCRIPT language=''JavaScript''>"
895 " <!-- "
896 " vis[''"+couche+"''] = ''hide'';"
897 " //-->"
898 " </SCRIPT>"
899 " <TR>"
900 " <TD>"
901 " <DIV ID=''Layer"+couche+"'' STYLE=''display: none;''>"
902 ]
903 mputl(HTML_DATA,htmlfile)
904 end
905
906 ind_name=strsubst(special_name(names(kname))," ","-")
907 ind_name=strsubst(ind_name,"|-|","")
908
909 HTML_DATA=[
910 "<A HREF="""+dic+".htm#"+ind_name+""" TARGET=""dic"">"+strsubst(names(kname)," |-| ","--")+"</A><BR>"]
911 mputl(HTML_DATA,htmlfile)
912
913end
914HTML_DATA=[
915 " </DIV>"
916 " </TD>"
917 " </TR>"
918 "</TABLE>"
919 HTML_FILE_END]
920
921mputl(HTML_DATA,htmlfile)
922mclose(htmlfile);
923endfunction
924
925//****************************************************************************************
926// function [out]=special_name(in)
927// Copyright INRIA
928// Deals with operator names
929//****************************************************************************************
930function [out]=special_name(in)
931if in=="+" then
932 out="plus"
933elseif in=="-" then
934 out="minus"
935elseif in==".*." then
936 out="kronecker product"
937elseif in=="./." then
938 out="kronecker right division"
939elseif in==".\." then
940 out="kronecker letf division"
941elseif in=="/" then
942 out="right division"
943elseif in=="./" then
944 out="elementwise right division"
945elseif in==".\" | in==".\textbackslash" then
946 out="elementwise left division"
947elseif in=="<MATH>^</MATH>" | in=="^" | in=="\textasciicircum" then
948 out="exponent"
949elseif in==".<MATH>^</MATH>" | in==".^" | in==".\textasciicircum" then
950 out="elementwise exponent"
951elseif in=="*" then
952 out="multiplication"
953elseif in==".*" then
954 out="elementwise multiplication"
955elseif in=="<MATH>&gt;</MATH>" | in=="$>$" | in=="&gt;" then
956 out="greater than"
957elseif in=="<MATH>&lt;</MATH>" | in=="$<$" | in=="&lt;"then
958 out="smaller than"
959elseif in=="<MATH>&gt;</MATH>=" | in=="$>$=" | in=="&gt;=" then
960 out="greater or equal to"
961elseif in=="<MATH>&lt;</MATH>=" | in=="$<$=" | in=="&lt;=" then
962 out="smaller or equal to"
963elseif in=="==" then
964 out="equal to"
965elseif in=="~=" then
966 out="not equal to"
967elseif in=="''" then
968 out="transpose"
969elseif in==".''" then
970 out="elementwise transpose"
971elseif in=="&amp;" | in=="\&" then
972 out="logical AND"
973elseif in=="<MATH>|</MATH>" | in=="|" | in=="$|$" then
974 out="logical OR"
975elseif in=="\" | in=="\textbackslash" then
976 out="left division"
977elseif in==":" then
978 out="colon"
979elseif in=="~" then
980 out="negation"
981elseif in=="\$" | in=="$" | in=="end (index)" then
982 out="Last index"
983elseif in=="~MSDOS" then
984 out="isunix"
985else
986 out=strsubst(in,"\_","");
987 out=strsubst(out,"_","");
988 out=strsubst(out,"%","");
989 out=strsubst(out,"$","");
990end
991endfunction
992
993//****************************************************************************************
994// function [entry]=index_entry(in)
995// Copyright INRIA
996// Finds index entries
997//****************************************************************************************
998function [entry]=index_entry(in)
999if dic=="M2SCI" & or(in==["i","j","eps","ans","pi","end (index)"]) then
1000 entry="Variables"
1001elseif part(in,1)=="%" | part(in,2)=="%" | in=="$" | in=="\$" | ~isempty(strindex(in,"MSDOS")) then
1002 entry="Variables"
1003elseif special_name(in)<>in & isempty(strindex(in,"_")) then
1004 entry="Operators"
1005else
1006 entry=convstr(part(in,1),"u")
1007end
1008endfunction
1009
1010//****************************************************************************************
1011// Batch instructions
1012//****************************************************************************************
1013disp("M2SCI");
1014xml2htmlpdf("matscifuns.xml","M2SCI")
1015disp("SCI2M");
1016xml2htmlpdf("matscifuns.xml","SCI2M")
1017disp("Doc done !")
diff --git a/scilab_doc/Dictionnaire-Matlab-Scilab/matscifuns.xml b/scilab_doc/Dictionnaire-Matlab-Scilab/matscifuns.xml
new file mode 100644
index 0000000..957c26a
--- /dev/null
+++ b/scilab_doc/Dictionnaire-Matlab-Scilab/matscifuns.xml
@@ -0,0 +1,3598 @@
1<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
2<!DOCTYPE MATSCIDOC SYSTEM "matsci.dtd">
3
4<!-- Functions are ordered by proto and then by names -->
5
6<MATSCIDOC>
7
8<!-- Converted by M2SCI kernel functions -->
9<MATSCIFUN>
10<MATNAME>ans</MATNAME>
11<SCINAME>ans</SCINAME>
12<DESCR>The most recent answer</DESCR>
13</MATSCIFUN>
14
15<MATSCIFUN>
16<MATNAME>case</MATNAME>
17<SCINAME>case</SCINAME>
18<DESCR>Case switch</DESCR>
19<NOTE>
20<P>
21In Matlab expression evaluated can be a cell, in this particular use, all values of cell are considered individually (similarly to a OR). In Scilab it can not be a cell (Matlab particularity can be replaced by others "case" or all switch/case statement can be replaced by a if/then/else statement.).
22</P>
23</NOTE>
24</MATSCIFUN>
25
26<MATSCIFUN>
27<MATNAME>else</MATNAME>
28<SCINAME>else</SCINAME>
29<DESCR>Conditionally execute statements</DESCR>
30</MATSCIFUN>
31
32<MATSCIFUN>
33<MATNAME>elseif</MATNAME>
34<SCINAME>elseif</SCINAME>
35<DESCR>Conditionally execute statements</DESCR>
36</MATSCIFUN>
37
38<MATSCIFUN>
39<MATNAME>end</MATNAME>
40<SCINAME>end</SCINAME>
41<DESCR>Terminate loops and conditionals</DESCR>
42</MATSCIFUN>
43
44<MATSCIFUN>
45<MATNAME>end (index)</MATNAME>
46<SCINAME>$</SCINAME>
47<DESCR>Last index</DESCR>
48</MATSCIFUN>
49
50<MATSCIFUN>
51<MATNAME>eps</MATNAME>
52<SCINAME>%eps</SCINAME>
53<DESCR>Floating-point relative accuracy</DESCR>
54<NOTE>
55<P>
56Only Matlab allows to change the value of this variable and clear eps allows to set the value of eps to its initial value.
57</P>
58</NOTE>
59</MATSCIFUN>
60
61<MATSCIFUN>
62<MATNAME>for</MATNAME>
63<SCINAME>for</SCINAME>
64<DESCR>Repeat statements a specific number of times</DESCR>
65<NOTE>
66<P>
67The variable used as loop index is clear in Scilab if all iterations have been made but is not clear if llop is ended by a break. In Matlab, this variable is never cleared.
68</P>
69</NOTE>
70</MATSCIFUN>
71
72<MATSCIFUN>
73<MATNAME>function</MATNAME>
74<SCINAME>function</SCINAME>
75<DESCR>Function definition</DESCR>
76</MATSCIFUN>
77
78<MATSCIFUN>
79<MATNAME>i</MATNAME>
80<SCINAME>%i</SCINAME>
81<DESCR>Imaginary unit</DESCR>
82<NOTE>
83<P>
84Only Matlab allows to change the value of this variable.
85</P>
86</NOTE>
87</MATSCIFUN>
88
89<MATSCIFUN>
90<MATNAME>if</MATNAME>
91<SCINAME>if</SCINAME>
92<DESCR>Conditionally execute statements</DESCR>
93<NOTE>
94<P>
95In Scilab condition can be ended by then but not in Matlab.
96</P>
97</NOTE>
98</MATSCIFUN>
99
100<MATSCIFUN>
101<MATNAME>j</MATNAME>
102<SCINAME>%i</SCINAME>
103<DESCR>Imaginary unit</DESCR>
104<NOTE>
105<P>
106Only Matlab allows to change the value of this variable.
107</P>
108</NOTE>
109</MATSCIFUN>
110
111<MATSCIFUN>
112<MATNAME>otherwise</MATNAME>
113<SCINAME>else</SCINAME>
114<DESCR>Default part of switch/select statement</DESCR>
115</MATSCIFUN>
116
117<MATSCIFUN>
118<MATNAME>pi</MATNAME>
119<SCINAME>%pi</SCINAME>
120<DESCR>Ratio of a circle's circumference to its diameter</DESCR>
121<NOTE>
122<P>
123Only Matlab allows to change the value of this variable.
124</P>
125</NOTE>
126</MATSCIFUN>
127
128<MATSCIFUN>
129<MATNAME>switch</MATNAME>
130<SCINAME>select</SCINAME>
131<DESCR>Switch among several cases based on expression</DESCR>
132</MATSCIFUN>
133
134<MATSCIFUN>
135<MATNAME>varargin</MATNAME>
136<SCINAME>varargin</SCINAME>
137<DESCR>Pass variable numbers of arguments</DESCR>
138<NOTE>
139<P>
140In Matlab varargin is a cell and in Scilab it is a list.
141</P>
142</NOTE>
143</MATSCIFUN>
144
145<MATSCIFUN>
146<MATNAME>varargout</MATNAME>
147<SCINAME>varargout</SCINAME>
148<DESCR>Return variable numbers of arguments</DESCR>
149<NOTE>
150<P>
151In Matlab varargout is a cell and in Scilab it is a list.
152</P>
153</NOTE>
154</MATSCIFUN>
155
156<MATSCIFUN>
157<MATNAME>while</MATNAME>
158<SCINAME>while</SCINAME>
159<DESCR>Repeat statements an indefinite number of times</DESCR>
160</MATSCIFUN>
161
162<!-- PROTO0 -->
163<MATSCIFUN>
164<MATNAME>abs</MATNAME>
165<SCINAME>abs</SCINAME>
166<DESCR>Absolute value and complex magnitude</DESCR>
167</MATSCIFUN>
168
169<MATSCIFUN>
170<MATNAME>bin2dec</MATNAME>
171<SCINAME>bin2dec</SCINAME>
172<DESCR>Returns the integer corresponding to a Given binary representation</DESCR>
173</MATSCIFUN>
174
175<MATSCIFUN>
176<MATNAME>dec2bin</MATNAME>
177<SCINAME>dec2bin</SCINAME>
178<DESCR>The binary representation of a decimal number</DESCR>
179</MATSCIFUN>
180
181<MATSCIFUN>
182<MATNAME>bitand</MATNAME>
183<SCINAME>bitand</SCINAME>
184<DESCR>The AND of two integers</DESCR>
185</MATSCIFUN>
186
187<MATSCIFUN>
188<MATNAME>bitor</MATNAME>
189<SCINAME>bitor</SCINAME>
190<DESCR>The OR of two integers</DESCR>
191</MATSCIFUN>
192
193<MATSCIFUN>
194<MATNAME>bitxor</MATNAME>
195<SCINAME>bitxor</SCINAME>
196<DESCR>Returns the exclusive OR of two integers</DESCR>
197</MATSCIFUN>
198
199<MATSCIFUN>
200<MATNAME>bitcmp</MATNAME>
201<SCINAME>bitcmp</SCINAME>
202<DESCR>The binary complementary of an integer</DESCR>
203</MATSCIFUN>
204
205<MATSCIFUN>
206<MATNAME>bitget</MATNAME>
207<SCINAME>bitget</SCINAME>
208<DESCR>Gets the bit of an integer whose the positon is given in the input argument</DESCR>
209</MATSCIFUN>
210
211<MATSCIFUN>
212<MATNAME>complex</MATNAME>
213<SCINAME>complex</SCINAME>
214<DESCR>Returns the complex form corresponding to the given real part and imaginary part</DESCR>
215</MATSCIFUN>
216
217<MATSCIFUN>
218<MATNAME>factor</MATNAME>
219<SCINAME>factor</SCINAME>
220<DESCR>Prime numbers decomposition</DESCR>
221</MATSCIFUN>
222
223<MATSCIFUN>
224<MATNAME>perms</MATNAME>
225<SCINAME>perms</SCINAME>
226<DESCR>Array of all permutations of vector components</DESCR>
227</MATSCIFUN>
228
229<MATSCIFUN>
230<MATNAME>primes</MATNAME>
231<SCINAME>primes</SCINAME>
232<DESCR>Returns the primes numbers included between 1 and given number</DESCR>
233</MATSCIFUN>
234
235<MATSCIFUN>
236<MATNAME>title</MATNAME>
237<SCINAME>title</SCINAME>
238<DESCR>Display a title on a graphic window</DESCR>
239</MATSCIFUN>
240
241<MATSCIFUN>
242<MATNAME>xlabel</MATNAME>
243<SCINAME>xlabel</SCINAME>
244<DESCR>Display a string along the x axis</DESCR>
245</MATSCIFUN>
246
247<MATSCIFUN>
248<MATNAME>ylabel</MATNAME>
249<SCINAME>ylabel</SCINAME>
250<DESCR>Display a string along the y axis</DESCR>
251</MATSCIFUN>
252
253<MATSCIFUN>
254<MATNAME>zlabel</MATNAME>
255<SCINAME>zlabel</SCINAME>
256<DESCR>Display a string along the z axis</DESCR>
257</MATSCIFUN>
258
259<MATSCIFUN>
260<MATNAME>cos</MATNAME>
261<SCINAME>cos</SCINAME>
262<DESCR>Cosine</DESCR>
263</MATSCIFUN>
264
265<MATSCIFUN>
266<MATNAME>cosh</MATNAME>
267<SCINAME>cosh</SCINAME>
268<DESCR>Hyperbolic cosine</DESCR>
269</MATSCIFUN>
270
271<MATSCIFUN>
272<MATNAME>erf</MATNAME>
273<SCINAME>erf</SCINAME>
274<DESCR>Error function</DESCR>
275</MATSCIFUN>
276
277<MATSCIFUN>
278<MATNAME>erfc</MATNAME>
279<SCINAME>erfc</SCINAME>
280<DESCR>Complementary error function</DESCR>
281</MATSCIFUN>
282
283<MATSCIFUN>
284<MATNAME>erfcx</MATNAME>
285<SCINAME>erfcx</SCINAME>
286<DESCR>Scaled complementary error function</DESCR>
287</MATSCIFUN>
288
289<MATSCIFUN>
290<MATNAME>gamma</MATNAME>
291<SCINAME>gamma</SCINAME>
292<DESCR>Gamma function</DESCR>
293</MATSCIFUN>
294
295<MATSCIFUN>
296<MATNAME>gammaln</MATNAME>
297<SCINAME>gammaln</SCINAME>
298<DESCR>Logarithm of gamma function</DESCR>
299</MATSCIFUN>
300
301<MATSCIFUN>
302<MATNAME>imag</MATNAME>
303<SCINAME>imag</SCINAME>
304<DESCR>Complex imaginary part</DESCR>
305</MATSCIFUN>
306
307<MATSCIFUN>
308<MATNAME>real</MATNAME>
309<SCINAME>real</SCINAME>
310<DESCR>Real part of a complex number</DESCR>
311</MATSCIFUN>
312
313<!-- PROTO1 -->
314<MATSCIFUN>
315<MATNAME>max</MATNAME>
316<SCINAME>max</SCINAME>
317<DESCR>Maximum</DESCR>
318<NOTE>
319<P>
320Matlab <B>max</B> function can work with complexes, what Scilab <B>max</B> can not, so a emulation function called <B>mtlb_max</B> has been written.
321</P>
322<P>
323Note that in Scilab, second input parameter can give the dimension to use to find the maximum values or another matrix (maximum of two matrices), in Matlab, dimension parameter is given in a third input parameter (in this case, second parameter must be <B>[]</B>).
324</P>
325<NOTE_ITEM LABEL="C=max(A)">If <B>A</B> is a matrix, <B>max(A)</B> is equivalent to <B>max(A,[],1)</B> in Matlab whereas in Scilab <B>max(A)</B> gives the maximum value found in <B>A</B>. Matlab <B>max</B> treats the values along the first non-singleton dimension.
326</NOTE_ITEM>
327</NOTE>
328<MATEX>
329A = [1,2,3;4,5,6]
330C = max(A)
331C = [4,5,6]
332C = max(A,[],1)
333C = [4,5,6]
334B=[7,8,9;2,3,4]
335C = max(A,B)
336C = [7,8,9;4,5,6]
337</MATEX>
338<SCIEX>
339A = [1,2,3;4,5,6]
340C = max(A)
341C = 6
342C = max(A,''r'')
343C = [4,5,6]
344B=[7,8,9;2,3,4]
345C = max(A,B)
346C = [7,8,9;4,5,6]
347</SCIEX>
348</MATSCIFUN>
349
350<MATSCIFUN>
351<MATNAME>min</MATNAME>
352<SCINAME>min</SCINAME>
353<DESCR>Minimum</DESCR>
354<NOTE>
355<P>
356Matlab <B>min</B> function can work with complexes, what Scilab <B>min</B> can not, so a emulation function called <B>mtlb_min</B> has been written.
357</P>
358<P>
359Note that in Scilab, second input parameter can give the dimension to use to find the minimum values or another matrix (minimum of two matrices), in Matlab, dimension parameter is given in a third input parameter (in this case, second parameter must be <B>[])</B>.
360</P>
361<NOTE_ITEM LABEL="C=min(A)">If <B>A</B> is a matrix, <B>min(A)</B> is equivalent to <B>min(A,[],1)</B> in Matlab whereas in Scilab <B>min(A)</B> gives the minimum value found in <B>A</B>. Matlab <B>min</B> treats the values along the first non-singleton dimension.
362</NOTE_ITEM>
363</NOTE>
364<MATEX>
365A = [1,2,3;4,5,6]
366C = min(A)
367C = [1,2,3]
368C = min(A,[],1)
369C = [1,2,3]
370B = [7,8,9;2,3,4]
371C = min(A,B)
372C = [1,2,3;2,3,4]
373</MATEX>
374<SCIEX>
375A = [1,2,3;4,5,6]
376C = min(A)
377C = 1
378C = min(A,''r'')
379C = [1,2,3]
380B = [7,8,9;2,3,4]
381C = min(A,B)
382C = [1,2,3;2,3,4]
383</SCIEX>
384</MATSCIFUN>
385
386<!-- PROTO2 -->
387<MATSCIFUN>
388<MATNAME>cumprod</MATNAME>
389<SCINAME>cumprod</SCINAME>
390<DESCR>Cumulative product</DESCR>
391<NOTE>
392<NOTE_ITEM LABEL="C = cumprod(A)">If <B>A</B> is a matrix, <B>cumprod(A)</B> is equivalent to <B>cumprod(A,1)</B> in Matlab whereas in Scilab <B>cumprod(A)</B> gives the cumulative product of all the entries of <B>A</B> taken columnwise. Actually, Matlab works on the first non-singleton dimension and Scilb does not.
393</NOTE_ITEM>
394<NOTE_ITEM LABEL="C = cumprod(A,dim)">Matlab can work with dim greater than number of dimensions of <B>A</B> but Scilab can not, in this can use <B>mtlb_cumprod</B> instead.
395</NOTE_ITEM>
396</NOTE>
397<MATEX>
398B = cumprod([1,2,3;4,5,6])
399B = [1,2,3;4,10,18]
400B = cumprod([1,2,3;4,5,6],1)
401B = [1,2,3;4,10,18]
402</MATEX>
403<SCIEX>
404B = cumprod([1,2,3;4,5,6])
405B = [1,8,120;4,40,720]
406B = cumprod([1,2,3;4,5,6],1)
407B = [1,2,3;4,10,18]
408</SCIEX>
409</MATSCIFUN>
410
411<MATSCIFUN>
412<MATNAME>cumsum</MATNAME>
413<SCINAME>cumsum</SCINAME>
414<DESCR>Cumulative sum</DESCR>
415<NOTE>
416<NOTE_ITEM LABEL="C=cumsum(A)">If A is a matrix, <B>cumsum(A)</B> is equivalent to <B>cumsum(A,1)</B> in Matlab whereas in Scilab <B>cumsum(A)</B> gives the cumulative sum of all the entries of <B>A</B> taken columnwise. Actually, Matlab works on the first non-singleton dimension and Scilb does not.
417</NOTE_ITEM>
418<NOTE_ITEM LABEL="C = cumsum(A,dim)">Matlab can work with dim greater than number of dimensions of <B>A</B> but Scilab can not, in this can use <B>mtlb_cumsum</B> instead.
419</NOTE_ITEM>
420</NOTE>
421<MATEX>
422B = cumsum([1,2,3;4,5,6])
423B=[1,2,3;5,7,9]
424B = cumsum([1,2,3;4,5,6],1)
425B=[1,2,3;5,7,9]
426</MATEX>
427<SCIEX>
428B = cumsum([1,2,3;4,5,6])
429B=[1,7,15;5,12,21]
430B = cumsum([1,2,3;4,5,6],1)
431B=[1,2,3;5,7,9]
432</SCIEX>
433</MATSCIFUN>
434
435<!-- PROTO3 -->
436<MATSCIFUN>
437<MATNAME>eye</MATNAME>
438<SCINAME>eye</SCINAME>
439<DESCR>Identity matrix</DESCR>
440<NOTE>
441<P>
442Note that in Matlab, <B>A</B> can contain complex values (in these cases, only real part of <B>A</B> is taken in account), what Scilab function do not tolerate.
443</P>
444<NOTE_ITEM LABEL="B=eye(A)">
445If A is a scalar, then Matlab returns a <B>A*A</B> identity matrix but in Scilab you get a <B>1</B>, use <B>eye(A,A)</B> to get the same matrix <B>B</B>. If <B>A</B> is a vector, Scilab and Matlab give the same <B>B</B>. Finally, if <B>A</B> is a matrix, in Scilab, <B>B</B> will be a matrix having the same size as <B>A</B> whereas in Matlab, you get an error message.
446</NOTE_ITEM>
447</NOTE>
448<MATEX>
449B = eye(2)
450B = [1,0;0,1]
451B = eye(2,2)
452B = [1,0;0,1]
453B = eye([3,3])
454B = [1,0,0;0,1,0;0,0,1]
455</MATEX>
456<SCIEX>
457B = eye(2)
458B = 1
459B = eye(2,2)
460B = [1,0;0,1]
461B = eye([3,3])
462B = [1,0]
463</SCIEX>
464</MATSCIFUN>
465
466<MATSCIFUN>
467<MATNAME>false</MATNAME>
468<SCINAME>No equivalent</SCINAME>
469<DESCR>False array</DESCR>
470<NOTE>
471<P>
472To get the same result in Scilab, use: <B>zeros(...)==1</B>. See <B>zeros</B>.
473</P>
474</NOTE>
475</MATSCIFUN>
476
477<MATSCIFUN>
478<MATNAME>ones</MATNAME>
479<SCINAME>ones</SCINAME>
480<DESCR>Create an array of all ones</DESCR>
481<NOTE>
482<P>
483Note that in Matlab, <B>A</B> can contain complex values (in these cases, only real part of <B>A</B> is taken in account), what Scilab function do not tolerate.
484</P>
485<NOTE_ITEM LABEL="B=ones(A)">
486If A is a scalar, then Matlab returns a <B>A*A</B> matrix of ones but in Scilab you get a <B>1</B>, use <B>ones(A,A)</B> to get the same matrix <B>B</B>. If <B>A</B> is a vector, Scilab and Matlab give the same <B>B</B>. Finally, if <B>A</B> is a matrix, in Scilab, <B>B</B> will be a matrix having the same size as <B>A</B> whereas in Matlab, you get an error message.
487</NOTE_ITEM>
488</NOTE>
489<MATEX>
490B = ones(2)
491B = [1,1;1,1]
492B = ones(2,2)
493B = [1,1;1,1]
494B = ones([3,3])
495B = [1,1,1;1,1,1;1,1,1]
496</MATEX>
497<SCIEX>
498B = ones(2)
499B = 1
500B = ones(2,2)
501B = [1,1;1,1]
502B = ones([3,3])
503B = [1,1]
504</SCIEX>
505</MATSCIFUN>
506
507<MATSCIFUN>
508<MATNAME>rand(A)</MATNAME>
509<SCINAME>rand(A[,''uniform''])</SCINAME>
510<DESCR>Uniformly distributed random numbers and arrays</DESCR>
511<NOTE>
512<NOTE_ITEM LABEL="B=rand(A)">
513If <B>A</B> is a scalar, then Matlab returns a <B>A*A</B> random matrix but in Scilab you get a single random value, use <B>rand(A,A)</B> to get the same matrix <B>B</B>. Finally, if <B>A</B> is a matrix, in Scilab, <B>B</B> will be a matrix having the same size as <B>A</B> whereas in Matlab, you get an error message.
514</NOTE_ITEM>
515<P>
516Note that in Matlab, <B>A</B> can contain complex values (in these cases, only real part of <B>A</B> is taken in account), what Scilab function do not tolerate.
517</P>
518<P>
519Particular case: To get the state of the uniform generator, in Matlab you have to use <B>s=rand('state')</B> to get 35 current values of the generator, but Scilab equivalent <B>s=rand(``seed'')</B> return only one value.
520</P>
521</NOTE>
522</MATSCIFUN>
523
524<MATSCIFUN>
525<MATNAME>randn(A)</MATNAME>
526<SCINAME>rand(A,''normal'')</SCINAME>
527<DESCR>Normally distributed random numbers and arrays</DESCR>
528<NOTE>
529<NOTE_ITEM LABEL="B=randn(A) |-| B=rand(A,``normal'')">
530If <B>A</B> is a scalar, then Matlab returns a <B>A*A</B> random matrix but in Scilab you get a single random value, use <B>rand(A,A,''normal'')</B> to get the same matrix <B>B</B>. Finally, if <B>A</B> is a matrix, in Scilab, <B>B</B> will be a matrix having the same size as <B>A</B> whereas in Matlab, you get an error message.
531</NOTE_ITEM>
532<P>
533Note that in Matlab, <B>A</B> can contain complex values (in these cases, only real part of <B>A</B> is taken in account), what Scilab function do not tolerate.
534</P>
535<P>
536Particular case: To get the state of the normal generator, in Matlab you have to use <B>s=randn('state')</B> to get 2 current values of the generator, but Scilab equivalent <B>s=rand(``seed'')</B> return only one value.
537</P>
538</NOTE>
539</MATSCIFUN>
540
541<MATSCIFUN>
542<MATNAME>true</MATNAME>
543<SCINAME>No equivalent</SCINAME>
544<DESCR>True array</DESCR>
545<NOTE>
546<P>
547To get the same result in Scilab, use: <B>ones(...)==1</B>. See <B>ones</B>.
548</P>
549</NOTE>
550</MATSCIFUN>
551
552<MATSCIFUN>
553<MATNAME>zeros</MATNAME>
554<SCINAME>zeros</SCINAME>
555<DESCR>Create an array of all zeros</DESCR>
556<NOTE>
557<NOTE_ITEM LABEL="B=zeros(A)">If <B>A</B> is a scalar, then Matlab returns a <B>A*A</B> matrix of zeros but in Scilab you get a <B>1</B>, use <B>zeros(A,A)</B> to get the same matrix <B>B</B>. If <B>A</B> is a row vector, Scilab and Matlab give the same <B>B</B>. Finally, if <B>A</B> is a matrix, in Scilab, <B>B</B> will be a matrix having the same size as <B>A</B> whereas in Matlab, you get an error message.
558</NOTE_ITEM>
559<P>
560Note that in Matlab, <B>A</B> can contain complex values (in these cases, only real part of <B>A</B> is taken in account), what Scilab function do not tolerate.
561</P>
562</NOTE>
563<MATEX>
564B = zeros(2)
565B = [0,;0,0]
566B = zeros(2,2)
567B = [0,0;0,0]
568B = zeros([3,3])
569B = [0,0,0;0,0,0;0,0,0]
570</MATEX>
571<SCIEX>
572B = zeros(2)
573B = 0
574B = zeros(2,2)
575B = [0,0;0,0]
576B = zeros([3,3])
577B = [0,0]
578</SCIEX>
579</MATSCIFUN>
580
581<!-- PROTO4 -->
582<MATSCIFUN>
583<MATNAME>acosh</MATNAME>
584<SCINAME>acosh</SCINAME>
585<DESCR>Inverse hyperbolic cosine</DESCR>
586</MATSCIFUN>
587
588<MATSCIFUN>
589<MATNAME>asinh</MATNAME>
590<SCINAME>asinh</SCINAME>
591<DESCR>Inverse hyperbolic sine</DESCR>
592</MATSCIFUN>
593
594<MATSCIFUN>
595<MATNAME>atan</MATNAME>
596<SCINAME>atan</SCINAME>
597<DESCR>Two-quadrant inverse tangent</DESCR>
598</MATSCIFUN>
599
600<MATSCIFUN>
601<MATNAME>conj</MATNAME>
602<SCINAME>conj</SCINAME>
603<DESCR>Complex conjugate</DESCR>
604</MATSCIFUN>
605
606<MATSCIFUN>
607<MATNAME>cot</MATNAME>
608<SCINAME>cotg</SCINAME>
609<DESCR>Cotangent</DESCR>
610</MATSCIFUN>
611
612<MATSCIFUN>
613<MATNAME>coth</MATNAME>
614<SCINAME>coth</SCINAME>
615<DESCR>Hyperbolic cotangent</DESCR>
616</MATSCIFUN>
617
618<MATSCIFUN>
619<MATNAME>exp</MATNAME>
620<SCINAME>exp</SCINAME>
621<DESCR>Exponential</DESCR>
622</MATSCIFUN>
623
624<MATSCIFUN>
625<MATNAME>expm</MATNAME>
626<SCINAME>expm</SCINAME>
627<DESCR>Matrix exponential</DESCR>
628</MATSCIFUN>
629
630<MATSCIFUN>
631<MATNAME>inv</MATNAME>
632<SCINAME>inv</SCINAME>
633<DESCR>Matrix inverse</DESCR>
634</MATSCIFUN>
635
636<MATSCIFUN>
637<MATNAME>log</MATNAME>
638<SCINAME>log</SCINAME>
639<DESCR>Natural logarithm</DESCR>
640</MATSCIFUN>
641
642<MATSCIFUN>
643<MATNAME>log10</MATNAME>
644<SCINAME>log10</SCINAME>
645<DESCR>Common (base 10) logarithm</DESCR>
646</MATSCIFUN>
647
648<MATSCIFUN>
649<MATNAME>sign</MATNAME>
650<SCINAME>sign</SCINAME>
651<DESCR>Signum function</DESCR>
652</MATSCIFUN>
653
654<MATSCIFUN>
655<MATNAME>sin</MATNAME>
656<SCINAME>sin</SCINAME>
657<DESCR>Sine</DESCR>
658</MATSCIFUN>
659
660<MATSCIFUN>
661<MATNAME>sinh</MATNAME>
662<SCINAME>sinh</SCINAME>
663<DESCR>Hyperbolic sine</DESCR>
664</MATSCIFUN>
665
666<MATSCIFUN>
667<MATNAME>sqrt</MATNAME>
668<SCINAME>sqrt</SCINAME>
669<DESCR>Square root</DESCR>
670</MATSCIFUN>
671
672<MATSCIFUN>
673<MATNAME>tan</MATNAME>
674<SCINAME>tan</SCINAME>
675<DESCR>Tangent</DESCR>
676</MATSCIFUN>
677
678<MATSCIFUN>
679 <MATNAME>tanh</MATNAME>
680 <SCINAME>tanh</SCINAME>
681 <DESCR>Hyperbolic tangent</DESCR>
682</MATSCIFUN>
683
684<!-- PROTO5 -->
685<MATSCIFUN>
686<MATNAME>asin</MATNAME>
687<SCINAME>asin</SCINAME>
688<DESCR>Inverse sine</DESCR>
689<NOTE>
690<P>In y=asin(x), for real elements of x outside the domain [-1,1], the complex part of Scilab y value is the opposite of Matlab y value.</P>
691</NOTE>
692<MATEX>
693y = asin(2)
694y = 1.5708 - 1.3170i
695</MATEX>
696<SCIEX>
697y = asin(2)
698y = 1.5708 + 1.3170i
699</SCIEX>
700</MATSCIFUN>
701
702<MATSCIFUN>
703<MATNAME>atanh</MATNAME>
704<SCINAME>atanh</SCINAME>
705<DESCR>Inverse hyperbolic tangent</DESCR>
706<NOTE>
707<P>In y=atanh(x), for real elements of x outside the domain [-1,1], the complex part of Scilab y value is the opposite of Matlab y value.</P>
708</NOTE>
709<MATEX>
710y = atanh(2)
711y = 0.5493 + 1.5708i
712</MATEX>
713<SCIEX>
714y = atanh(2)
715y = 0.5493061 - 1.5707963i
716</SCIEX>
717</MATSCIFUN>
718
719<!-- PROTO6 -->
720<MATSCIFUN>
721<MATNAME>ceil</MATNAME>
722<SCINAME>ceil</SCINAME>
723<DESCR>Round up</DESCR>
724</MATSCIFUN>
725
726<MATSCIFUN>
727<MATNAME>cell2mat</MATNAME>
728<SCINAME>cell2mat</SCINAME>
729<DESCR>Convert a cell array into a matrix</DESCR>
730</MATSCIFUN>
731
732<MATSCIFUN>
733<MATNAME>cellstr</MATNAME>
734<SCINAME>cellstr</SCINAME>
735<DESCR>Convert strings vector (or strings matrix) into a cell of strings</DESCR>
736</MATSCIFUN>
737
738<MATSCIFUN>
739<MATNAME>fix</MATNAME>
740<SCINAME>fix</SCINAME>
741<DESCR>Round towards zero</DESCR>
742</MATSCIFUN>
743
744<MATSCIFUN>
745<MATNAME>floor</MATNAME>
746<SCINAME>floor</SCINAME>
747<DESCR>Round down</DESCR>
748</MATSCIFUN>
749
750<MATSCIFUN>
751<MATNAME>round</MATNAME>
752<SCINAME>round</SCINAME>
753<DESCR>Round to nearest integer</DESCR>
754</MATSCIFUN>
755
756<!-- PROTO7 -->
757<MATSCIFUN>
758<MATNAME>tril</MATNAME>
759<SCINAME>tril</SCINAME>
760<DESCR>Lower triangular part of a matrix</DESCR>
761<NOTE>
762<P>
763In <B>L=tril(X)</B> and <B>L=tril(X,k)</B>, Scilab function gives different results from Matlab one if <B>X</B> is a String matrix. In this case use <B>mtlb_tril</B> instead.
764</P>
765<P>
766Note that <B>k</B> can be complex in Matlab, in this case, only real part of <B>k</B> is taken in account, Scilab gives an error message for a such use.
767</P>
768</NOTE>
769</MATSCIFUN>
770
771<MATSCIFUN>
772<MATNAME>triu</MATNAME>
773<SCINAME>triu</SCINAME>
774<DESCR>Upper triangular part of a matrix</DESCR>
775<NOTE>
776<P>
777In <B>U=triu(X)</B> and <B>U=triu(X,k)</B>, Scilab function gives different results from Matlab one if <B>X</B> is a String matrix. In this case use <B>mtlb_triu</B> instead.
778</P>
779<P>
780Note that <B>k</B> can be complex in Matlab, in this case, only real part of <B>k</B> is taken in account, Scilab gives an error message for a such use.
781</P>
782</NOTE>
783</MATSCIFUN>
784
785<!-- PROTO8 -->
786<MATSCIFUN>
787<MATNAME>prod</MATNAME>
788<SCINAME>prod</SCINAME>
789<DESCR>Product of array elements</DESCR>
790<NOTE>
791<NOTE_ITEM LABEL="M=prod(A)">Scilab <B>prod(A)</B> returns the product of all components of <B>A</B>. So, if <B>A</B> is a vector, then Scilab and Matlab work in the same way. If <B>A</B> is a matrix, Scilab <B>prod(A)</B> gives the product of all elements of <B>A</B> but Matlab returns the product of each column. Finally, if <B>A</B> is a multidimensional array, Matlab works on the first non-singleton dimension of <B>A</B> what Scilab does not. So, to be sure to find a Scilab equivalent for Matlab call to <B>prod</B> it is better to precise dimension on which to work.
792</NOTE_ITEM>
793<NOTE_ITEM LABEL="M=prod(A,dim)">In Scilab <B>dim=1</B> is equivalent to <B>dim=''r''</B> and <B>dim=2</B> is equivalent <B>dim=''c''</B>. In Matlab, <B>dim</B> can be greater then the number of dimension of <B>A</B> (in this case, <B>M=A</B>), in Scilab you will get an error message.
794</NOTE_ITEM>
795</NOTE>
796<MATEX>
797A = [1,2,3;4,5,6]
798M = prod(A)
799M = [4,10,18]
800M = prod(A,1)
801M = [4,10,18]
802</MATEX>
803<SCIEX>
804A = [1,2,3;4,5,6]
805M = prod(A)
806M = 720
807M = prod(A,''r'')
808M = [4,10,18]
809</SCIEX>
810</MATSCIFUN>
811
812<MATSCIFUN>
813<MATNAME>sum</MATNAME>
814<SCINAME>sum</SCINAME>
815<DESCR>Sum of array elements</DESCR>
816<NOTE>
817<NOTE_ITEM LABEL="M=sum(A)">Scilab <B>sum(A)</B> returns the sum of all components of <B>A</B>. So, if <B>A</B> is a vector, then Scilab and Matlab work in the same way. If <B>A</B> is a matrix, Scilab <B>sum(A)</B> gives the sum of all elements of <B>A</B> but Matlab returns the sum of each column. Finally, if <B>A</B> is a multidimensional array, Matlab works on the first non-singleton dimension of <B>A</B> what Scilab does not. So, to be sure to find a Scilab equivalent for Matlab call to <B>sum</B> it is better to precise dimension on which to work.
818</NOTE_ITEM>
819<NOTE_ITEM LABEL="M=sum(A,dim)">In Scilab <B>dim=1</B> is equivalent to <B>dim=''r''</B> and <B>dim=2</B> is equivalent <B>dim=''c''</B>. In Matlab, dim can be greater then the number of dimension of <B>A</B> (in this case, <B>M=A</B>), in Scilab you will get an error message.
820</NOTE_ITEM>
821</NOTE>
822<MATEX>
823A = [1,2,3;4,5,6]
824M = sum(A)
825M = [5,7,9]
826M = sum(A,1)
827M = [5,7,9]
828</MATEX>
829<SCIEX>
830A = [1,2,3;4,5,6]
831M = sum(A)
832M = 21
833M = sum(A,''r'')
834M = [5,7,9]
835</SCIEX>
836</MATSCIFUN>
837
838<!-- PROT9 -->
839<MATSCIFUN>
840<MATNAME>int8</MATNAME>
841<SCINAME>int8</SCINAME>
842<DESCR>Convert to 8-bit signed integer</DESCR>
843<NOTE>
844<P>
845For infinite values, Scilab and Matlab <B>int8</B> return different values.
846</P>
847</NOTE>
848<MATEX>
849A = int8(inf)
850A = 127
851A = int8(-inf)
852A = -128
853</MATEX>
854<SCIEX>
855A = int8(%inf)
856A = 0
857A = int8(-%inf)
858A = 0
859</SCIEX>
860</MATSCIFUN>
861
862<MATSCIFUN>
863<MATNAME>int16</MATNAME>
864<SCINAME>int16</SCINAME>
865<DESCR>Convert to 16-bit signed integer</DESCR>
866<NOTE>
867<P>
868For infinite and NaNs values, Scilab and Matlab <B>int16</B> return different values.
869</P>
870</NOTE>
871<MATEX>
872A = int16(inf)
873A = 32767
874A = int16(-inf)
875A = -32768
876A = int16(nan)
877A = 0
878</MATEX>
879<SCIEX>
880A = int16(%inf)
881A = -32768
882A = int16(-%inf)
883A = -32768
884A = int16(%nan)
885A = -32768
886</SCIEX>
887</MATSCIFUN>
888
889<MATSCIFUN>
890<MATNAME>int32</MATNAME>
891<SCINAME>int32</SCINAME>
892<DESCR>Convert to 32-bit signed integer</DESCR>
893<NOTE>
894<P>
895For infinite and NaNs values, Scilab and Matlab <B>int32</B> return different values.
896</P>
897</NOTE>
898<MATEX>
899A = int32(inf)
900A = 2147483647
901A = int32(-inf)
902A = -2147483648
903A = int32(nan)
904A = 0
905</MATEX>
906<SCIEX>
907A = int32(%inf)
908A = -2147483648
909A = int32(-%inf)
910A = -2147483648
911A = int32(%nan)
912A = -2147483648
913</SCIEX>
914</MATSCIFUN>
915
916<MATSCIFUN>
917<MATNAME>uint8</MATNAME>
918<SCINAME>uint8</SCINAME>
919<DESCR>Convert to 8-bit unsigned integer</DESCR>
920<NOTE>
921<P>
922For infinite values, Scilab and Matlab <B>uint8</B> return different values.
923</P>
924</NOTE>
925<MATEX>
926A = uint8(inf)
927A = 255
928</MATEX>
929<SCIEX>
930A = uint8(%inf)
931A = 0
932</SCIEX>
933</MATSCIFUN>
934
935<MATSCIFUN>
936<MATNAME>uint16</MATNAME>
937<SCINAME>uint16</SCINAME>
938<DESCR>Convert to 16-bit unsigned integer</DESCR>
939<NOTE>
940<P>
941For infinite values, Scilab and Matlab <B>uint16</B> return different values.
942</P>
943</NOTE>
944<MATEX>
945A = uint16(inf)
946A = 65535
947</MATEX>
948<SCIEX>
949A = uint16(%inf)
950A = 0
951</SCIEX>
952</MATSCIFUN>
953
954<MATSCIFUN>
955<MATNAME>uint32</MATNAME>
956<SCINAME>uint32</SCINAME>
957<DESCR>Convert to 32-bit unsigned integer</DESCR>
958<NOTE>
959<P>
960For infinite values, Scilab and Matlab <B>uint32</B> return different values.
961</P>
962</NOTE>
963<MATEX>
964A = uint32(inf)
965A = 4294967295
966</MATEX>
967<SCIEX>
968A = uint32(%inf)
969A = 0
970</SCIEX>
971</MATSCIFUN>
972
973<!-- PROTO10 -->
974<MATSCIFUN>
975<MATNAME>lower(str)</MATNAME>
976<SCINAME>convstr(str,''u'')</SCINAME>
977<DESCR>Convert string to lower case</DESCR>
978<NOTE>
979<P>
980If <B>A</B> is not a character string matrix, Scilab equivalent for <B>B=lower(A)</B> is <B>B=A</B>, else equivalent is <B>B=convstr(A)</B>.
981</P>
982</NOTE>
983</MATSCIFUN>
984
985<MATSCIFUN>
986<MATNAME>upper(str)</MATNAME>
987<SCINAME>convstr(str,''u'')</SCINAME>
988<DESCR>Convert string to upper case</DESCR>
989<NOTE>
990<P>
991If <B>A</B> is not a character string matrix, Scilab equivalent for <B>B=upper(A)</B> is <B>B=A</B>, else equivalent is <B>B=convstr(A,''u'')</B>.
992</P>
993</NOTE>
994</MATSCIFUN>
995
996<!-- PROTO11-->
997<MATSCIFUN>
998<MATNAME>dos</MATNAME>
999<SCINAME>unix_g</SCINAME>
1000<DESCR>Execute a UNIX command and return result</DESCR>
1001<NOTE>
1002<P>
1003Output values order is inversed in Scilab and in Matlab.
1004</P>
1005<P>
1006In Scilab use <B>disp</B> to emulate Matlab <B>-echo</B> option.
1007</P>
1008</NOTE>
1009<MATEX>
1010[status,result] = dos(...)
1011</MATEX>
1012<SCIEX>
1013[result,status] = unix_g(...)
1014</SCIEX>
1015</MATSCIFUN>
1016
1017<MATSCIFUN>
1018<MATNAME>unix</MATNAME>
1019<SCINAME>unix_g</SCINAME>
1020<DESCR>Execute a UNIX command and return result</DESCR>
1021<NOTE>
1022<P>
1023Output values order is inversed in Scilab and in Matlab.
1024</P>
1025<P>
1026In Scilab use <B>disp</B> to emulate Matlab <B>-echo</B> option.
1027</P>
1028</NOTE>
1029<MATEX>
1030[status,result] = unix(...)
1031</MATEX>
1032<SCIEX>
1033[result,status] = unix_g(...)
1034</SCIEX>
1035</MATSCIFUN>
1036
1037<!-- PROTO12 -->
1038<MATSCIFUN>
1039<MATNAME>who</MATNAME>
1040<SCINAME>who</SCINAME>
1041<DESCR>List variables in the workspace</DESCR>
1042<NOTE>
1043<P>
1044Scilab <B>who</B> is an equivalent for Matlab <B>who</B> just when called as follows: <B>who</B> or <B>who("global")</B>
1045</P>
1046</NOTE>
1047</MATSCIFUN>
1048
1049<MATSCIFUN>
1050<MATNAME>whos</MATNAME>
1051<SCINAME>whos</SCINAME>
1052<DESCR>List variables in the workspace</DESCR>
1053<NOTE>
1054<P>
1055Scilab <B>whos</B> is an equivalent for Matlab <B>whos</B> just when called as follows: <B>whos</B> or <B>whos("global")</B>
1056</P>
1057</NOTE>
1058</MATSCIFUN>
1059
1060<!-- PROTO13 -->
1061<MATSCIFUN>
1062<MATNAME>all</MATNAME>
1063<SCINAME>and</SCINAME>
1064<DESCR>Test to determine if all elements are nonzero</DESCR>
1065<NOTE>
1066<P>
1067Matlab <B>all</B> function can work with complexes, what Scilab <B>and</B> can not, so a call to <B>abs</B> function can be necessary when translating from Matlab to Scilab.
1068</P>
1069<NOTE_ITEM LABEL="B=all(A) |-| B=and(A)">
1070If <B>A</B> is a matrix, <B>all(A)</B> is equivalent to <B>all(A,1)</B> in Matlab whereas in Scilab <B>and(A)</B> is a logical AND of all elements of <B>A</B>. If <B>A</B> is a multidimensional array then Matlab treats the values along the first non-singleton dimension, but Scilab returns logical AND of all elements of <B>A</B>.
1071</NOTE_ITEM>
1072<NOTE_ITEM LABEL="B=all(A,dim) |-| B=and(A,dim)">
1073In Scilab <B>dim=1</B> is equivalent to <B>dim=''r''</B> and <B>dim=2</B> is equivalent <B>dim=''c''</B>. In Matlab, <B>dim</B> can be greater then the number of dimension of <B>A</B> (in this case, <B>B=A</B>), in Scilab you will get an error message.
1074</NOTE_ITEM>
1075</NOTE>
1076<MATEX>
1077y = all([1,1,0;1,0,1])
1078y = [1,0,0]
1079y = all([1,1,0;1,0,1],1)
1080y = [1,0,0]
1081 </MATEX>
1082 <SCIEX>
1083y = and([1,1,0;1,0,1])
1084y = %F
1085y = and([1,1,0;1,0,1],1)
1086y = [%T,%F,%F]
1087 </SCIEX>
1088</MATSCIFUN>
1089
1090<MATSCIFUN>
1091<MATNAME>any</MATNAME>
1092<SCINAME>or</SCINAME>
1093<DESCR>Test to determine if any nonzeros elements</DESCR>
1094<NOTE>
1095<P>
1096Matlab <B>any</B> function can work with complexes, what Scilab <B>or</B> can not, so a call to <B>abs</B> function can be necessary when translating from Matlab to Scilab.
1097</P>
1098<NOTE_ITEM LABEL="B=any(A) |-| B=or(A)">
1099If <B>A</B> is a matrix, <B>any(A)</B> is equivalent to <B>any(A,1)</B> in Matlab whereas in Scilab <B>or(A)</B> is a logical OR of all elements of <B>A</B>. If <B>A</B> is a multidimensional array then Matlab treats the values along the first non-singleton dimension, but Scilab returns logical OR of all elements of <B>A</B>.
1100</NOTE_ITEM>
1101<NOTE_ITEM LABEL="B=any(A,dim) |-| B=or(A,dim)">
1102In Scilab <B>dim=1</B> is equivalent to <B>dim=''r''</B> and <B>dim=2</B> is equivalent <B>dim=''c''</B>. In Matlab, <B>dim</B> can be greater then the number of dimension of <B>A</B> (in this case, <B>B=A</B>), in Scilab you will get an error message.
1103</NOTE_ITEM>
1104</NOTE>
1105<MATEX>
1106y = any([1,1,0;1,0,1])
1107y = [1,1,1]
1108y = any([1,1,0;1,0,1],1)
1109y = [1,1,1]
1110</MATEX>
1111<SCIEX>
1112y = or([1,1,0;1,0,1])
1113y = %T
1114y = or([1,1,0;1,0,1],1)
1115y = [%T,%T,%T]
1116</SCIEX>
1117</MATSCIFUN>
1118
1119<!-- PROTO14 -->
1120<MATSCIFUN>
1121<MATNAME>acos</MATNAME>
1122<SCINAME>acos</SCINAME>
1123<DESCR>Inverse cosine</DESCR>
1124</MATSCIFUN>
1125
1126<!-- PROTO15 -->
1127<MATSCIFUN>
1128<MATNAME>nargin |-| nargin('fun')</MATNAME>
1129<SCINAME>argn(2) |-| size(getfield(1,macrovar(fun)),"*")</SCINAME>
1130<DESCR>Number of function input arguments</DESCR>
1131</MATSCIFUN>
1132
1133<MATSCIFUN>
1134<MATNAME>nargout |-| nargout('fun')</MATNAME>
1135<SCINAME>argn(1) |-| size(getfield(2,macrovar(fun)),"*")</SCINAME>
1136<DESCR>Number of function output arguments</DESCR>
1137</MATSCIFUN>
1138
1139<!-- Other functions -->
1140<MATSCIFUN>
1141<MATNAME>acot(A)</MATNAME>
1142<SCINAME>atan(1 ./A)</SCINAME>
1143<DESCR>Inverse cotangent</DESCR>
1144</MATSCIFUN>
1145
1146<MATSCIFUN>
1147<MATNAME>acoth(A)</MATNAME>
1148<SCINAME>atanh(1 ./A)</SCINAME>
1149<DESCR>Inverse hyperbolic cotangent</DESCR>
1150<NOTE>
1151<P>In Matlab <B>y=acoth(x)</B> and Scilab <B>y=atanh(1 ./x)</B>, for real elements of <B>x</B> outside the domain <B>[-1,1]</B>, the complex part of Scilab <B>y</B> value is the opposite of Matlab <B>y</B> value. See <B>atanh</B>/.</P>
1152</NOTE>
1153</MATSCIFUN>
1154
1155<MATSCIFUN>
1156<MATNAME>acsc(A)</MATNAME>
1157<SCINAME>asin(1 ./A)</SCINAME>
1158<DESCR>Inverse cosecant</DESCR>
1159</MATSCIFUN>
1160
1161<MATSCIFUN>
1162<MATNAME>acsch(A)</MATNAME>
1163<SCINAME>asinh(1 ./A)</SCINAME>
1164<DESCR>Inverse hyperbolic cosecant</DESCR>
1165</MATSCIFUN>
1166
1167<MATSCIFUN>
1168<MATNAME>angle(A)</MATNAME>
1169<SCINAME>atan(imag(A),real(A))</SCINAME>
1170<DESCR>Phase angle</DESCR>
1171</MATSCIFUN>
1172
1173<MATSCIFUN>
1174<MATNAME>asec(A)</MATNAME>
1175<SCINAME>acos(1 ./A)</SCINAME>
1176<DESCR>Inverse secant</DESCR>
1177</MATSCIFUN>
1178
1179<MATSCIFUN>
1180<MATNAME>asech(A)</MATNAME>
1181<SCINAME>acosh(1 ./A)</SCINAME>
1182<DESCR>Inverse hyperbolic secant</DESCR>
1183</MATSCIFUN>
1184
1185<MATSCIFUN>
1186<MATNAME>atan2</MATNAME>
1187<SCINAME>atan2</SCINAME>
1188<DESCR>Four-quadrant inverse tangent</DESCR>
1189<NOTE>
1190<P>
1191Matlab <B>atan2</B> function can work with complexes (in this case, complex part is ignored), what Scilab <B>atan</B> can not.
1192</P>
1193</NOTE>
1194</MATSCIFUN>
1195
1196<MATSCIFUN>
1197<MATNAME>balance</MATNAME>
1198<SCINAME>balanc</SCINAME>
1199<DESCR>Diagonal scaling to improve eigenvalue accuracy</DESCR>
1200<NOTE>
1201<P>
1202There is no equivalent for <B>B=balance(A)</B> in Scilab, <B>balanc</B> function does not work with only one output value.
1203</P>
1204<P>
1205When used with two outputs, these functions return value in inverse order.
1206</P>
1207</NOTE>
1208<MATEX>
1209[T,Ab] = balance(A)
1210</MATEX>
1211<SCIEX>
1212[Ab,T] = balanc(A)
1213</SCIEX>
1214</MATSCIFUN>
1215
1216<MATSCIFUN>
1217<MATNAME>bar</MATNAME>
1218<SCINAME>bar</SCINAME>
1219<DESCR>Bar histogram</DESCR>
1220</MATSCIFUN>
1221
1222<MATSCIFUN>
1223<MATNAME>barh</MATNAME>
1224<SCINAME>barh</SCINAME>
1225<DESCR>Bar histogram horizontal</DESCR>
1226</MATSCIFUN>
1227
1228<MATSCIFUN>
1229<MATNAME>beep</MATNAME>
1230<SCINAME>beep</SCINAME>
1231<DESCR>Produce a beep sound</DESCR>
1232<NOTE>
1233<P>
1234Scilab <B>beep</B> always returns a value but not Matlab function.
1235</P>
1236</NOTE>
1237</MATSCIFUN>
1238
1239<MATSCIFUN>
1240<MATNAME>besseli</MATNAME>
1241<SCINAME>besseli</SCINAME>
1242<DESCR>Modified Bessel functions of the first kind </DESCR>
1243<NOTE>
1244<P>
1245Scilab <B>besseli</B> function can work with only one output argument, but the Matlab function can work with two outputs arguments.
1246</P>
1247</NOTE>
1248<MATEX>
1249y = besseli(alpha,x)
1250y = besseli(alpha,x,1)
1251[y,ierr] = besseli(alpha,...)
1252</MATEX>
1253<SCIEX>
1254y = besseli(alpha,x)
1255y = besseli(alpha,x,ice),ice = 1 or ice = 2
1256</SCIEX>
1257</MATSCIFUN>
1258
1259<MATSCIFUN>
1260<MATNAME>besselj</MATNAME>
1261<SCINAME>besselj</SCINAME>
1262<DESCR>Bessel functions of the first kind </DESCR>
1263<NOTE>
1264<P>
1265Scilab <B>besselj</B> function can work with only one output argument, but the Matlab function can work with two outputs arguments.
1266</P>
1267</NOTE>
1268<MATEX>
1269y = besselj(alpha,x)
1270y = besselj(alpha,x,1)
1271[y,ierr] = besselj(alpha,...)
1272</MATEX>
1273<SCIEX>
1274y = besselj(alpha,x)
1275y = besselj(alpha,x,ice),ice = 1 or ice = 2
1276</SCIEX>
1277</MATSCIFUN>
1278
1279<MATSCIFUN>
1280<MATNAME>besselk</MATNAME>
1281<SCINAME>besselk</SCINAME>
1282<DESCR>Modified Bessel functions of the second kind </DESCR>
1283<NOTE>
1284<P>
1285Scilab <B>besselk</B> function can work with only one output argument, but the Matlab function can work with two outputs arguments.
1286</P>
1287</NOTE>
1288<MATEX>
1289y = besselk(alpha,x)
1290y = besselk(alpha,x,1)
1291[y,ierr] = besselk(alpha,...)
1292</MATEX>
1293<SCIEX>
1294y = besselk(alpha,x)
1295y = besselk(alpha,x,ice),ice = 1 or ice = 2
1296</SCIEX>
1297</MATSCIFUN>
1298
1299<MATSCIFUN>
1300<MATNAME>bessely</MATNAME>
1301<SCINAME>bessely</SCINAME>
1302<DESCR>Bessel functions of the second kind </DESCR>
1303<NOTE>
1304<P>
1305Scilab <B>bessely</B> function can work with only one output argument, but the Matlab function can work with two outputs arguments.
1306</P>
1307</NOTE>
1308<MATEX>
1309y = bessely(alpha,x)
1310y = bessely(alpha,x,1)
1311[y,ierr] = bessely(alpha,...)
1312</MATEX>
1313<SCIEX>
1314y = bessely(alpha,x)
1315y = bessely(alpha,x,ice),ice = 1 or ice = 2
1316</SCIEX>
1317</MATSCIFUN>
1318
1319<MATSCIFUN>
1320<MATNAME>beta</MATNAME>
1321<SCINAME>beta</SCINAME>
1322<DESCR>Beta function</DESCR>
1323<NOTE>
1324<P>
1325Matlab <B>beta</B> function can work with only one scalar input an done not-scalar input parameter, but in Scilab both parameters must have the same size.
1326</P>
1327</NOTE>
1328<MATEX>
1329A = 1;
1330B = [1 2 3];
1331Y = beta(A,B);
1332</MATEX>
1333<SCIEX>
1334A = 1;
1335B = [1 2 3];
1336// So that A and B have the same size
1337tmp = A;A = B;A(:) = tmp;
1338Y = beta(A,B);
1339</SCIEX>
1340</MATSCIFUN>
1341
1342<MATSCIFUN>
1343<MATNAME>blanks</MATNAME>
1344<SCINAME>No equivalent</SCINAME>
1345<DESCR>A string of blanks</DESCR>
1346<NOTE>
1347<P>
1348There is no Scilab equivalent function for Matlab box but it can be easyly replaced by Scilab equivalent instructions.
1349</P>
1350</NOTE>
1351<MATEX>
1352A = ['xxx' blanks(20) 'yyy'];
1353</MATEX>
1354<SCIEX>
1355A = "xxx"+part(" ",ones(1,20))+"yyy";
1356</SCIEX>
1357</MATSCIFUN>
1358
1359<MATSCIFUN>
1360<MATNAME>box</MATNAME>
1361<SCINAME>No equivalent</SCINAME>
1362<DESCR>Display axes border</DESCR>
1363<NOTE>
1364<P>
1365There is no Scilab equivalent function for Matlab box but it can be easyly replaced by Scilab equivalent instructions.
1366</P>
1367</NOTE>
1368<MATEX>
1369box on
1370box off
1371box
1372box(h,'on')
1373box(h,'off')
1374box(h)
1375</MATEX>
1376<SCIEX>
1377a = gca();
1378a.box = "on";
1379a.box = "off";
1380if a.box=="on" then a.box="off";else a.box="on";end;
1381h.box = "on";
1382h.box = "off";
1383if h.box=="on" then h.box="off";else h.box="on";end;
1384</SCIEX>
1385</MATSCIFUN>
1386
1387<MATSCIFUN>
1388<MATNAME>break</MATNAME>
1389<SCINAME>break</SCINAME>
1390<DESCR>Terminate execution of a for loop or while loop</DESCR>
1391</MATSCIFUN>
1392
1393<MATSCIFUN>
1394<MATNAME>cat</MATNAME>
1395<SCINAME>cat</SCINAME>
1396<DESCR>Arrays concatenation</DESCR>
1397</MATSCIFUN>
1398
1399<MATSCIFUN>
1400<MATNAME>cd</MATNAME>
1401<SCINAME>cd</SCINAME>
1402<DESCR>Change/get working directory</DESCR>
1403<NOTE>
1404<P>
1405Note that <B>cd ..</B> does not work in Scilab, but it does in Matlab. In Scilab you can use <B>cd("..")</B>.
1406</P>
1407</NOTE>
1408</MATSCIFUN>
1409
1410<MATSCIFUN>
1411<MATNAME>cell</MATNAME>
1412<SCINAME>cell</SCINAME>
1413<DESCR>Create cell array</DESCR>
1414<NOTE>
1415<P>
1416Note that in Matlab, input can contain complex values (in these cases, only real part of it is taken in account), what Scilab function do not tolerate.
1417</P>
1418</NOTE>
1419</MATSCIFUN>
1420
1421<MATSCIFUN>
1422<MATNAME>chol</MATNAME>
1423<SCINAME>chol</SCINAME>
1424<DESCR>Cholesky factorization</DESCR>
1425<NOTE>
1426<P>
1427Scilab <B>chol</B> function can only have one output whereas Matlab one can have two ouputs.
1428</P>
1429</NOTE>
1430</MATSCIFUN>
1431
1432<MATSCIFUN>
1433<MATNAME>cla</MATNAME>
1434<SCINAME>No equivalent</SCINAME>
1435<DESCR>Clear current axes</DESCR>
1436<NOTE>
1437<NOTE_ITEM LABEL="cla">
1438Scilab equivalent could be <B>a = gca();delete(a.children);</B> but in this case, all current axes children will be deleted because there is no HandleVisibility property in Scilab graphics.
1439</NOTE_ITEM>
1440<NOTE_ITEM LABEL="cla reset">
1441Scilab equivalent is <B>a = gca();delete(a.children);</B>.
1442</NOTE_ITEM>
1443</NOTE>
1444</MATSCIFUN>
1445
1446<MATSCIFUN>
1447<MATNAME>clc</MATNAME>
1448<SCINAME>clc([nblines])</SCINAME>
1449<DESCR>Clear Command Window</DESCR>
1450<NOTE>
1451<P>
1452Note that Scilab function allows to clear only a set of lines above the cursor using <B>clc(nblines)</B>.
1453</P>
1454<P>
1455Note that Scilab function can not be used in no window mode under Unix/Linux while Matlab one clears the terminal display as if you were using "clear" command.
1456</P>
1457</NOTE>
1458</MATSCIFUN>
1459
1460<MATSCIFUN>
1461<MATNAME>clear</MATNAME>
1462<SCINAME>clear</SCINAME>
1463<DESCR>Remove items from workspace, freeing up system memory</DESCR>
1464<NOTE>
1465<P>
1466Scilab and Matlab <B>clear</B> functions are only equivalent when called using <B>clear</B> or <B>clear name</B>.
1467</P>
1468<NOTE_ITEM LABEL="clear global ...">
1469Scilab equivalent for Matlab <B>clear global [name]</B> is <B>clearglobal([name])</B>.
1470</NOTE_ITEM>
1471<NOTE_ITEM LABEL="clear variables ...">
1472Scilab equivalent for Matlab <B>clear variables</B> is simply <B>clear</B>.
1473</NOTE_ITEM>
1474<NOTE_ITEM LABEL="clear keyword ...">
1475For all other keywords, there is no Scilab equivalent for Matlab <B>clear call</B>.
1476</NOTE_ITEM>
1477</NOTE>
1478</MATSCIFUN>
1479
1480<MATSCIFUN>
1481<MATNAME>clock</MATNAME>
1482<SCINAME>No equivalent</SCINAME>
1483<DESCR>Current time as a date vector</DESCR>
1484<NOTE>
1485<P>
1486Even if there no equivalent for Matlab <B>clock</B> in Scilab, it can be emuled as shown in example.
1487</P>
1488</NOTE>
1489<MATEX>
1490c = clock
1491</MATEX>
1492<SCIEX>
1493w = getdate();
1494w(3:5) = [];
1495w(6) = w(6)+w(7)/1000;
1496c = w(1:6);
1497</SCIEX>
1498</MATSCIFUN>
1499
1500<MATSCIFUN>
1501<MATNAME>clf</MATNAME>
1502<SCINAME>clf</SCINAME>
1503<DESCR>Clear current figure window</DESCR>
1504<NOTE>
1505<NOTE_ITEM LABEL="clf">
1506In this case, all current figure children will be deleted because there is no HandleVisibility property in Scilab graphics.
1507</NOTE_ITEM>
1508<NOTE_ITEM LABEL="fig_handle = clf">
1509Scilab equivalent is be <B>fig_handle = gcf();clf;</B>. In this case, all current figure children will be deleted because there is no HandleVisibility property in Scilab graphics.
1510</NOTE_ITEM>
1511</NOTE>
1512</MATSCIFUN>
1513
1514<MATSCIFUN>
1515<MATNAME>close</MATNAME>
1516<SCINAME>close |-| xdel |-| delete</SCINAME>
1517<DESCR>Delete specified figure</DESCR>
1518<NOTE>
1519<NOTE_ITEM LABEL="close">
1520If current figure is a uicontrol one, Scilab and Matlab <B>close</B> are equivalent. But if current figure is a graphic window, Scilab equivalent for Matlab <B>close</B> is <B>delete(gcf())</B>.
1521</NOTE_ITEM>
1522<NOTE_ITEM LABEL="close(h)">
1523If <B>h</B> is a uicontrol figure, Scilab and Matlab <B>close(h)</B> are equivalent. But if <B>h</B> is a graphic window, Scilab equivalent for Matlab <B>close(h)</B> is <B>delete(h)</B>.
1524</NOTE_ITEM>
1525<NOTE_ITEM LABEL="close('all')">
1526Scilab equivalent for Matlab <B>close('all')</B> is <B>xdel(winsid())</B>.
1527</NOTE_ITEM>
1528<NOTE_ITEM LABEL="close(name)">
1529There is no Scilab equivalent for Matlab <B>close(name)</B> however, <B>mtlb_close</B> can be an equivalent.
1530</NOTE_ITEM>
1531<NOTE_ITEM LABEL="close('all','hidden')">
1532Scilab equivalent for Matlab <B>close('all','hidden')</B> is <B>xdel(winsid())</B> but Scilab kills all figures even if they are hidden.
1533</NOTE_ITEM>
1534</NOTE>
1535</MATSCIFUN>
1536
1537<MATSCIFUN>
1538<MATNAME>closereq</MATNAME>
1539<SCINAME>delete(gcf())</SCINAME>
1540<DESCR>Default figure close request function</DESCR>
1541</MATSCIFUN>
1542
1543<MATSCIFUN>
1544<MATNAME>colordef</MATNAME>
1545<SCINAME>No equivalent</SCINAME>
1546<DESCR>Set default property values to display different color schemes</DESCR>
1547<NOTE>
1548<NOTE_ITEM LABEL="[h = ]mtlb_colordef(color_option)">
1549Scilab equivalent is <B>fig = gcf();fig.background = -1;[h = fig];</B> if <B>color_option</B> is equal to "black" or "none" and <B>fig = gcf();fig.background = -1;[h = fig];</B> else.
1550</NOTE_ITEM>
1551<NOTE_ITEM LABEL="[h = ]mtlb_colordef(fig,color_option)">
1552Considering <B>fig</B> is a graphics handle, Scilab equivalent is <B>fig.background = -1;[h = fig];</B> if <B>color_option</B> is equal to "black" or "none" and <B>fig.background = -2;[h = fig];</B> else.
1553</NOTE_ITEM>
1554<NOTE_ITEM LABEL="[h = ]mtlb_colordef('new',color_option)">
1555Scilab equivalent is <B>fig=scf(max(winsid())+1);fig.background = -1;[h = fig];</B> if <B>color_option</B> is equal to "black" or "none" and <B>fig=scf(max(winsid())+1);fig.background = -2;[h = fig];</B> else.
1556</NOTE_ITEM>
1557</NOTE>
1558</MATSCIFUN>
1559
1560<MATSCIFUN>
1561<MATNAME>continue</MATNAME>
1562<SCINAME>continue</SCINAME>
1563<DESCR>Keyword to pass control to the next iteration of a loop</DESCR>
1564</MATSCIFUN>
1565
1566<MATSCIFUN>
1567<MATNAME>csc(A)</MATNAME>
1568<SCINAME>1 ./sin(A)</SCINAME>
1569<DESCR>Cosecant</DESCR>
1570</MATSCIFUN>
1571
1572<MATSCIFUN>
1573<MATNAME>conv</MATNAME>
1574<SCINAME>convol</SCINAME>
1575<DESCR>Convolution</DESCR>
1576<NOTE>
1577<P>
1578Scilab <B>convol</B> output value is always a row vector while Matlab <B>conv</B> output value is a column vector if at least one input is a column vector.
1579</P>
1580<P>
1581To have a closer result, replace Matlab <B>conv(A)</B> by <B>clean(convol(A))</B> in Scilab.
1582</P>
1583</NOTE>
1584</MATSCIFUN>
1585
1586<MATSCIFUN>
1587<MATNAME>cputime</MATNAME>
1588<SCINAME>timer()</SCINAME>
1589<DESCR>Elapsed CPU time</DESCR>
1590</MATSCIFUN>
1591
1592<MATSCIFUN>
1593<MATNAME>csch(A)</MATNAME>
1594<SCINAME>1 ./sinh(A)</SCINAME>
1595<DESCR>Hyperbolic cosecant</DESCR>
1596</MATSCIFUN>
1597
1598<MATSCIFUN>
1599<MATNAME>date</MATNAME>
1600<SCINAME>date()</SCINAME>
1601<DESCR>Current date string</DESCR>
1602</MATSCIFUN>
1603
1604<MATSCIFUN>
1605<MATNAME>dec2hex</MATNAME>
1606<SCINAME>dec2hex</SCINAME>
1607<DESCR>Decimal to hexadecimal number conversion</DESCR>
1608<NOTE>
1609<NOTE_ITEM LABEL="Empty matrix input">
1610In Matlab <B>dec2hex</B> returns <B>""</B> when input is <B>[]</B> but Scilab <B>dec2hex</B> returns <B>[]</B>.
1611</NOTE_ITEM>
1612<NOTE_ITEM LABEL="Complex inputs">
1613In Matlab <B>dec2hex</B> automatically removes complex part of input but not in Scilab.
1614</NOTE_ITEM>
1615<NOTE_ITEM LABEL="Two inputs">
1616In Matlab <B>dec2hex</B> can have two inputs, in Scilab <B>mtlb_dec2hex</B> emulates this case.
1617</NOTE_ITEM>
1618</NOTE>
1619</MATSCIFUN>
1620
1621<MATSCIFUN>
1622<MATNAME>delete</MATNAME>
1623<SCINAME>mdelete |-| delete</SCINAME>
1624<DESCR>Delete files or graphics objects</DESCR>
1625<NOTE>
1626<NOTE_ITEM LABEL="Files">
1627When Matlab <B>delete</B> is used to delete a file, Scilab equivalent is <B>mdelete</B>.
1628</NOTE_ITEM>
1629<NOTE_ITEM LABEL="Graphics objects">
1630When Matlab <B>delete</B> is used to delete a graphics object, Scilab equivalent is <B>delete</B>. Note that Scilab <B>delete</B> can delete a set of graphics handles is its input is a matrix of such objects.
1631</NOTE_ITEM>
1632</NOTE>
1633</MATSCIFUN>
1634
1635<MATSCIFUN>
1636<MATNAME>det</MATNAME>
1637<SCINAME>det</SCINAME>
1638<DESCR>Determinant</DESCR>
1639</MATSCIFUN>
1640
1641<MATSCIFUN>
1642<MATNAME>diag</MATNAME>
1643<SCINAME>diag</SCINAME>
1644<DESCR>Diagonal including or extracting </DESCR>
1645<NOTE>
1646<P>
1647Due to the fact that strings or not considered in the same way in Matlab and in Scilab, results are not equal if <B>A</B> is a string matrix or vector in <B>diag(A)</B> or <B>diag(A,k)</B>.
1648</P>
1649<P>
1650Note that <B>mtlb_diag</B> can emulate this particularity in Scilab.
1651</P>
1652</NOTE>
1653<MATEX>
1654B = diag('str')
1655B = ['s ';' t ';' r']
1656</MATEX>
1657<SCIEX>
1658B = diag(``str'')
1659B = ``str''
1660B = mtlb_diag(``str'')
1661B = [``s ``;'' t ``;'' r'']
1662</SCIEX>
1663</MATSCIFUN>
1664
1665<MATSCIFUN>
1666<MATNAME>diary</MATNAME>
1667<SCINAME>diary</SCINAME>
1668<DESCR>Save session to a file</DESCR>
1669<NOTE>
1670<P>
1671When a filename is given to save environment, if this file exists, Scilab returns an error message while Matlab save environment at the end of existing file (append).
1672</P>
1673<P>
1674Note that <B>diary on</B> and <B>diary toggle</B> exist only in Matlab.
1675</P>
1676<P>
1677The equivalent for Matlab <B>diary off</B> is <B>diary(0)</B> in Scilab.
1678</P>
1679</NOTE>
1680</MATSCIFUN>
1681
1682<MATSCIFUN>
1683<MATNAME>diff</MATNAME>
1684<SCINAME>diff</SCINAME>
1685<DESCR>Differences and approximate derivatives</DESCR>
1686<NOTE>
1687<NOTE_ITEM LABEL="Y = diff(X[,n])">For this kind of use of <B>diff</B> (dim parameter not given), Matlab works on the first non-singleton dimension of <B>X</B> what Scilab does not. In this case, Scilab considers dim to be <B>"*"</B> so that diff threats all values of <B>X</B>, what Matlab does not.
1688</NOTE_ITEM>
1689<NOTE_ITEM LABEL="Y = diff(X,n,dim)">If dimension given by <B>dim</B> reaches 1 before <B>n</B> iterations have been done, Matlab switches to next non-singleton dimension, but Scilab does not, use <B>mtlb_diff</B> to get equivalent results...
1690</NOTE_ITEM>
1691<P>
1692When <B>n</B> is greater than all existing dimensions of <B>X</B>, Matlab returns <B>[]</B> what Scilab may not give for all inputs...
1693</P>
1694</NOTE>
1695</MATSCIFUN>
1696
1697<MATSCIFUN>
1698<MATNAME>dir</MATNAME>
1699<SCINAME>dir</SCINAME>
1700<DESCR>Display directory listing</DESCR>
1701<NOTE>
1702<P>
1703When used in command window, Scilab and Matlab <B>dir</B> are equivalents. When result is stored in a value, Matlab returns a struture but Scilab returns a tlist. To get the same result, you can use <B>mtlb_dir</B>, note that in this case, hidden files are not get.
1704</P>
1705</NOTE>
1706</MATSCIFUN>
1707
1708<MATSCIFUN>
1709<MATNAME>disp</MATNAME>
1710<SCINAME>disp</SCINAME>
1711<DESCR>Display text or array</DESCR>
1712</MATSCIFUN>
1713
1714<MATSCIFUN>
1715<MATNAME>display</MATNAME>
1716<SCINAME>display</SCINAME>
1717<DESCR>Overloaded method to display an object</DESCR>
1718</MATSCIFUN>
1719
1720<MATSCIFUN>
1721<MATNAME>doc</MATNAME>
1722<SCINAME>help</SCINAME>
1723<DESCR>Display online documentation</DESCR>
1724</MATSCIFUN>
1725
1726<MATSCIFUN>
1727<MATNAME>docopt</MATNAME>
1728<SCINAME>No equivalent</SCINAME>
1729<DESCR>Web browser for UNIX platforms</DESCR>
1730<NOTE>
1731<P>
1732There no Scilab equivalent function, however, information about Web Browser used can be found using global
1733variable <B>%browsehelp</B>. Thos variables exists under all platforms.
1734</P>
1735</NOTE>
1736</MATSCIFUN>
1737
1738<MATSCIFUN>
1739<MATNAME>double</MATNAME>
1740<SCINAME>double</SCINAME>
1741<DESCR>Conversion to double precision</DESCR>
1742<NOTE>
1743<P>
1744In Matlab, this function returns a Boolean type value for a Boolean input whereas Scilab function returns a Double type value.
1745</P>
1746</NOTE>
1747</MATSCIFUN>
1748
1749<MATSCIFUN>
1750<MATNAME>drawnow</MATNAME>
1751<SCINAME>No equivalent</SCINAME>
1752<DESCR>Complete pending drawing events</DESCR>
1753<NOTE>
1754<P>
1755In Scilab, drawing events are executed immediately.
1756</P>
1757<P>
1758Scilab <B>drawnow</B> is different from Matlab one.
1759</P>
1760</NOTE>
1761</MATSCIFUN>
1762
1763<MATSCIFUN>
1764<MATNAME>echo</MATNAME>
1765<SCINAME>mode</SCINAME>
1766<DESCR>Echo lines during execution</DESCR>
1767<NOTE>
1768<P>
1769Scilab <B>mode</B> and Matlab <B>echo</B> are not exactly equivalents but they both change the information displayed during execution. Scilab <B>mode</B> has to be called inside a script or a function but Matlab <B>echo</B> can be called from prompt. However, some uses are equivalents such as:
1770</P>
1771<NOTE_ITEM LABEL="echo"> is equivalent to Scilab <B>mode(abs(mode()-1))</B> for scripts and non-compiled functions
1772</NOTE_ITEM>
1773<NOTE_ITEM LABEL="echo on"> is equivalent to Scilab <B>mode(1)</B> for scripts and non-compiled functions
1774</NOTE_ITEM>
1775<NOTE_ITEM LABEL="echo off"> is equivalent to Scilab <B>mode(0)</B>
1776</NOTE_ITEM>
1777</NOTE>
1778</MATSCIFUN>
1779
1780<MATSCIFUN>
1781<MATNAME>eig</MATNAME>
1782<SCINAME>spec |-| bdiag</SCINAME>
1783<DESCR>Find eigenvalues and eigenvectors</DESCR>
1784<NOTE>
1785<NOTE_ITEM LABEL="eig(A)">
1786Scilab equivalent for <B>eig(A)</B> is <B>spec(A)</B>. Scilab eigen vector matrix can differ from Matlab one...
1787</NOTE_ITEM>
1788<NOTE_ITEM LABEL="eig(A,'nobalance')">
1789There is no Scilab equivalent for <B>'nobalance'</B> option. See examples...
1790</NOTE_ITEM>
1791<NOTE_ITEM LABEL="eig(A,B,flag)">
1792There is no Scilab equivalent for <B>flag</B>.
1793</NOTE_ITEM>
1794</NOTE>
1795<MATEX>
1796d = eig(A,'balance')
1797[V,D] = eig(A,'balance')
1798d = eig(A,B)
1799[V,D] = eig(A,B)
1800</MATEX>
1801<SCIEX>
1802d = spec(A)
1803[V,D] = bdiag(A+%i,1/%eps)
1804[al,be] = spec(A); d = al./be;
1805[al,be,V] = spec(A); D = spec(al./be);
1806</SCIEX>
1807</MATSCIFUN>
1808
1809<MATSCIFUN>
1810<MATNAME>error</MATNAME>
1811<SCINAME>error</SCINAME>
1812<DESCR>Display error messages</DESCR>
1813<NOTE>
1814<P>
1815Scilab <B>error</B> function can only take one character string as input but Matlab function can take more than one character string as input and also numerical values...
1816</P>
1817</NOTE>
1818</MATSCIFUN>
1819
1820<MATSCIFUN>
1821<MATNAME>etime</MATNAME>
1822<SCINAME>etime</SCINAME>
1823<DESCR>Elapsed time</DESCR>
1824<NOTE>
1825<P>
1826In Scilab, <B>etime</B> can be used with 6 and 10 value vectors but Matlab <B>etime</B> can only be used with 6 value vectors ([Year Month Day Hour Minute Second]).
1827</P>
1828</NOTE>
1829</MATSCIFUN>
1830
1831<MATSCIFUN>
1832<MATNAME>eval</MATNAME>
1833<SCINAME>evstr |-| execstr</SCINAME>
1834<DESCR>Execute a string containing an instruction/expression</DESCR>
1835<NOTE>
1836<NOTE_ITEM LABEL="Expression">
1837When <B>eval</B> has to execute an expression then Scilab equivalent for <B>eval</B> is <B>evstr</B>
1838</NOTE_ITEM>
1839<NOTE_ITEM LABEL="Instruction">
1840When <B>eval</B> has to execute an instruction with just one output value then Scilab equivalent for <B>eval</B> is <B>evstr</B>. If instruction has more than one output value then <B>execstr</B> has to be used as follows.
1841</NOTE_ITEM>
1842<P>
1843When <B>eval</B> is used with two inputs then an equivalent can be found in examples below.
1844</P>
1845</NOTE>
1846<MATEX>
1847eval('1+1')
1848eval('x=1+1')
1849eval('[d1,d2]=size(1)')
1850[d1,d2]=eval('size(1)')
1851eval('1+1','1+2')
1852</MATEX>
1853<SCIEX>
1854evstr('1+1')
1855x = evstr('1+1')
1856execstr('[d1,d2]=size(1)')
1857execstr('[d1,d2]=size(1)')
1858if execstr("1+1","errcatch") then execstr("1+2");end
1859</SCIEX>
1860</MATSCIFUN>
1861
1862<MATSCIFUN>
1863<MATNAME>exist</MATNAME>
1864<SCINAME>exist</SCINAME>
1865<DESCR>Check if a variable or file exists</DESCR>
1866<NOTE>
1867<P>
1868Scilab <B>exist</B> function only works for variables, not for M-files or else...
1869</P>
1870<P>
1871Scilab <B>mtlb_exist</B> function is a partial emulation for Matlab <B>exist</B>
1872</P>
1873</NOTE>
1874</MATSCIFUN>
1875
1876<MATSCIFUN>
1877<MATNAME>interp1</MATNAME>
1878<SCINAME>interp1</SCINAME>
1879<DESCR>One_dimension interpolation function</DESCR>
1880<NOTE>
1881<P>
1882Scilab <B>interp1</B> function doesn't work with the pchip interpolation method.
1883</P>
1884</NOTE>
1885</MATSCIFUN>
1886
1887<MATSCIFUN>
1888<MATNAME>exit</MATNAME>
1889<SCINAME>exit</SCINAME>
1890<DESCR>Ends current session</DESCR>
1891</MATSCIFUN>
1892
1893<MATSCIFUN>
1894<MATNAME>fclose</MATNAME>
1895<SCINAME>mclose</SCINAME>
1896<DESCR>Close one or more open files</DESCR>
1897</MATSCIFUN>
1898
1899<MATSCIFUN>
1900<MATNAME>feof</MATNAME>
1901<SCINAME>meof</SCINAME>
1902<DESCR>Test for end-of-file</DESCR>
1903</MATSCIFUN>
1904
1905<MATSCIFUN>
1906<MATNAME>ferror</MATNAME>
1907<SCINAME>mclearerr |-| merror</SCINAME>
1908<DESCR>Query about errors in file input or output</DESCR>
1909<NOTE>
1910<NOTE_ITEM LABEL="ferror(fid)">
1911When Matlab <B>ferror</B> is called with just one input and one output, then Scilab equivalent is <B>merror</B>.
1912</NOTE_ITEM>
1913<NOTE_ITEM LABEL="ferror(fid,'clear')">
1914When Matlab <B>ferror</B> is called with two inputs and just one output, then Scilab equivalent is <B>mclearerr</B>.
1915</NOTE_ITEM>
1916<P>
1917For all other cases, there no equivalent in Scilab.
1918</P>
1919</NOTE>
1920</MATSCIFUN>
1921
1922<MATSCIFUN>
1923<MATNAME>feval</MATNAME>
1924<SCINAME>evstr |-| execstr</SCINAME>
1925<DESCR>Function evaluation</DESCR>
1926<NOTE>
1927<NOTE_ITEM LABEL="One output">
1928In this case Scilab <B>evstr</B> is an equivalent to <B>feval</B>, after modifying inputs such as in examples below.
1929</NOTE_ITEM>
1930<NOTE_ITEM LABEL="More than one output">
1931In this case Scilab <B>execstr</B> is an equivalent to <B>feval</B>, after modifying inputs such as in examples below.
1932</NOTE_ITEM>
1933</NOTE>
1934<MATEX>
1935[y1] = feval(@cos,0)
1936[y1,y2] = feval(@size,1)
1937</MATEX>
1938<SCIEX>
1939y1 = evstr("cos(0)")
1940execstr("[y1,y2] = size(1)")
1941</SCIEX>
1942</MATSCIFUN>
1943
1944<MATSCIFUN>
1945<MATNAME>fft(A[,...])</MATNAME>
1946<SCINAME>fft(A,-1[,...])</SCINAME>
1947<DESCR>Discrete Fourier transform</DESCR>
1948<NOTE>
1949<NOTE_ITEM LABEL="Y = fft(X)">If X is a vector then Scilab equivalent for Matlab <B>fft(X)</B> is <B>fft(X,-1)</B>. If <B>X</B> is a matrix then Scilab equivalent for Matlab <B>fft(X)</B> is <B>fft(X,-1,2,1)</B>.
1950</NOTE_ITEM>
1951<NOTE_ITEM LABEL="Y = fft(X,n) / Y = fft(X,n,dim) / Y = fft(X,[],dim)">There is no Scilab equivalent for all these Matlab uses of <B>fft</B>, in these cases, use <B>mtlb_fft</B> instead.
1952</NOTE_ITEM>
1953</NOTE>
1954</MATSCIFUN>
1955
1956<MATSCIFUN>
1957<MATNAME>fftshift</MATNAME>
1958<SCINAME>fftshift</SCINAME>
1959<DESCR>Shift zero-frequency component of discrete Fourier transform to center of spectrum</DESCR>
1960<NOTE>
1961<NOTE_ITEM LABEL="fftshift(A[,dim])">
1962Due to the fact that strings or not considered in the same way in Matlab and in Scilab, results are not equal if A is a string matrix or vector in fftshift(A) or fftshift(A,dim). <B>mtlb_fftshift</B> can emulate this particularity in Scilab.
1963</NOTE_ITEM>
1964<NOTE_ITEM LABEL="fftshift(A,dim)">
1965In Matlab, <B>dim</B> can be greater than the number of dimensions of <B>A</B> but in Scilab you get an error message in this case. <B>mtlb_fftshift</B> can emulate this particularity in Scilab.
1966</NOTE_ITEM>
1967</NOTE>
1968<MATEX>
1969Y = fftshift('str')
1970Y = 'rst'
1971</MATEX>
1972<SCIEX>
1973Y = fftshift('str')
1974Y = 'str'
1975Y = mtlb_fftshift('str')
1976Y = 'rst'
1977</SCIEX>
1978</MATSCIFUN>
1979
1980<MATSCIFUN>
1981<MATNAME>fgetl</MATNAME>
1982<SCINAME>mgetl</SCINAME>
1983<DESCR>Read line(s) from file, discard newline character</DESCR>
1984<NOTE>
1985<P>
1986Matlab <B>fgetl</B> reads file line per line while Scilab <B>mgetl</B> allows to read the whole file.
1987</P>
1988<P>
1989Matlab <B>fgetl</B> returns <B>-1</B> if it could not read a line in file but Scilab <B>mgetl</B> returns an empty string is this case. You can used <B>meof</B> to check if End Of File has been reached.
1990</P>
1991</NOTE>
1992</MATSCIFUN>
1993
1994<MATSCIFUN>
1995<MATNAME>fgets</MATNAME>
1996<SCINAME>fgetstr</SCINAME>
1997<DESCR>Read line from file, keep newline character</DESCR>
1998<NOTE>
1999<P>
2000Input parameter order is inversed in Scilab compared to Matlab.
2001</P>
2002</NOTE>
2003<MATEX>
2004fgets(fid,n)
2005</MATEX>
2006<SCIEX>
2007fgetstr(n,fid)
2008</SCIEX>
2009</MATSCIFUN>
2010
2011<MATSCIFUN>
2012<MATNAME>fileparts</MATNAME>
2013<SCINAME>fileparts</SCINAME>
2014<DESCR>Return filename parts</DESCR>
2015<NOTE>
2016<P>
2017Scilab function does not get file version but Matlab one does.
2018</P>
2019<P>
2020Scilab function can take a second input parameter specifying the output value we want to get saying: "path", "fname" or "extension".
2021</P>
2022</NOTE>
2023</MATSCIFUN>
2024
2025<MATSCIFUN>
2026<MATNAME>filesep</MATNAME>
2027<SCINAME>No equivalent</SCINAME>
2028<DESCR>Return the directory separator for this platform</DESCR>
2029<NOTE>
2030<P>
2031There is no Scilab function equivalent to Matlab <B>filesep</B> but the same output can be obtained with <B>pathconvert("/")</B>.
2032</P>
2033</NOTE>
2034</MATSCIFUN>
2035
2036<MATSCIFUN>
2037<MATNAME>find</MATNAME>
2038<SCINAME>find</SCINAME>
2039<DESCR>Find indices and values of nonzero elements</DESCR>
2040<NOTE>
2041<P>
2042Matlab function can work with complex values what is not possible in Scilab, however, using <B>abs</B> it is very easy to have the same results.
2043</P>
2044<P>
2045Note that Scilab function can only return two output values and Matlab one can return a third value that can be computed according to the first two output matrices as explained in Matlab help.
2046</P>
2047<P>
2048For example, in <B>[i,j,v]=find(X)</B>, <B>v</B> is equal to: <B>X(i+(j-1))<MATH>*</MATH>size(X,1)</B>.
2049</P>
2050<P>
2051Another great difference between Scilab and Matlab is that Matlab returns column vectors of indices when X is a column vector or a matrix but Scilab always returns row vectors. For this kind of input, use matrix to get the same output value...what is done mtlb_find()
2052</P>
2053</NOTE>
2054</MATSCIFUN>
2055
2056<MATSCIFUN>
2057<MATNAME>findstr</MATNAME>
2058<SCINAME>No equivalent</SCINAME>
2059<DESCR>Find one string within another</DESCR>
2060<NOTE>
2061<P>
2062There is no equivalent for <B>findstr</B> in Scilab, but an emulation function has been written: <B>mtlb_findstr</B>. Scilab <B>strindex</B> function is very similar to <B>findstr</B> but do not consider the size of the strings passed as parameters. <B>strindex</B> can replace <B>findstr</B> only if <B>findstr</B> can be replaced by <B>strfind</B> in Matlab.
2063</P>
2064</NOTE>
2065</MATSCIFUN>
2066
2067<MATSCIFUN>
2068<MATNAME>fliplr(A)</MATNAME>
2069<SCINAME>A(:,$:-1:1)</SCINAME>
2070<DESCR>Flip matrix in left/right direction</DESCR>
2071<NOTE>
2072<P>
2073Due to the fact that Scilab and Matlab do not consider character string in the same way, result is different for this kind of input, in this case, use <B>mtlb_fliplr</B> instead.
2074</P>
2075</NOTE>
2076</MATSCIFUN>
2077
2078<MATSCIFUN>
2079<MATNAME>flipud(A)</MATNAME>
2080<SCINAME>A($:-1:1,:)</SCINAME>
2081<DESCR>Flip matrix in up/down direction</DESCR>
2082</MATSCIFUN>
2083
2084<MATSCIFUN>
2085<MATNAME>fopen</MATNAME>
2086<SCINAME>mopen</SCINAME>
2087<DESCR>Open a file or obtain information about open files</DESCR>
2088<NOTE>
2089<NOTE_ITEM LABEL="Access permission">
2090Matlab offers two permissions options not supported by Scilab: <B>W</B> and <B>A</B> (for tape drives)
2091</NOTE_ITEM>
2092<NOTE_ITEM LABEL="Input values">
2093In Matlab, <B>fopen('all')</B> lists all opened files, in Scilab, this type of call for <B>fopen</B> does not exist. You can also use <B>fopen</B> in Matlab to get informations on a file identifier (<B>fopen(fid)</B>), this case is not implemented in Scilab.
2094</NOTE_ITEM>
2095<NOTE_ITEM LABEL="Machine format">
2096Note that Scilab does not support machine format values as input or output.
2097</NOTE_ITEM>
2098<P>
2099Matlab <B>fopen</B> can return an error message but not Scilab <B>mopen</B>, moreover, returned file identifier is <B>-1</B> in case of error in Matlab but does not exist in this case in Scilab, so an emulation function has been written <B>mtlb_fopen</B>.
2100</P>
2101</NOTE>
2102</MATSCIFUN>
2103
2104<MATSCIFUN>
2105<MATNAME>format</MATNAME>
2106<SCINAME>format</SCINAME>
2107<DESCR>Control display format for output</DESCR>
2108<NOTE>
2109<P>
2110Some Matlab formats have no Scilab equivalent, see examples below.
2111</P>
2112</NOTE>
2113<MATEX>
2114format
2115format +
2116format bank
2117format compact
2118format hex
2119format long
2120format long e
2121format long g
2122format loose
2123format rat
2124format short
2125format short e
2126format short g
2127</MATEX>
2128<SCIEX>
2129format("v",6)
2130format(6)
2131No equivalent for: format "bank"
2132No equivalent for: format "compact"
2133No equivalent for: format "hex"
2134format(16)
2135format("e",16)
2136format("e",16)
2137No equivalent for: format "loose"
2138No equivalent for: format "rat"
2139format(6)
2140format("e",6)
2141format("e",6)
2142</SCIEX>
2143</MATSCIFUN>
2144
2145<MATSCIFUN>
2146<MATNAME>fprintf</MATNAME>
2147<SCINAME>No equivalent</SCINAME>
2148<DESCR>Write formatted data to file</DESCR>
2149<NOTE>
2150<P>
2151There is no equivalent function for Matlab <B>fprintf</B> in Scilab but an emulation function has been written: <B>mtlb_fprintf</B>. This function probably not allows all Matlab <B>fprintf</B> possibilities...
2152</P>
2153</NOTE>
2154</MATSCIFUN>
2155
2156<MATSCIFUN>
2157<MATNAME>fread</MATNAME>
2158<SCINAME>No equivalent</SCINAME>
2159<DESCR>Read binary data to a file</DESCR>
2160<NOTE>
2161<P>
2162There is no equivalent function for Matlab <B>fread</B> in Scilab but an emulation function has been written: <B>mtlb_fread</B>. This function probably not allows all Matlab <B>fread</B> possibilities (<B>skip</B> parameter is ignored...).
2163</P>
2164</NOTE>
2165</MATSCIFUN>
2166
2167<MATSCIFUN>
2168<MATNAME>frewind(fid)</MATNAME>
2169<SCINAME>mseek("0",fid)</SCINAME>
2170<DESCR>Move the file position indicator to the beginning of an open file</DESCR>
2171</MATSCIFUN>
2172
2173<MATSCIFUN>
2174<MATNAME>fscanf</MATNAME>
2175<SCINAME>No equivalent</SCINAME>
2176<DESCR>Read formatted data to file</DESCR>
2177<NOTE>
2178<P>
2179There is no equivalent function for Matlab <B>fscanf</B> in Scilab but an emulation function has been written: <B>mtlb_fscanf</B>. This function probably not allows all Matlab <B>fscanf</B> possibilities...
2180</P>
2181</NOTE>
2182</MATSCIFUN>
2183
2184<MATSCIFUN>
2185<MATNAME>fseek</MATNAME>
2186<SCINAME>mseek</SCINAME>
2187<DESCR>Set file position indicator</DESCR>
2188<NOTE>
2189<P>
2190Scilab and Matlab functions differ by the flag which indicate the origin of the position indicator, see examples below. Note that order of input value is different...
2191</P>
2192</NOTE>
2193<MATEX>
2194File beginning:
2195fseek(fid,offset,'bof')
2196fseek(fid,offset,-1)
2197Current position:
2198fseek(fid,offset,'cof')
2199fseek(fid,offset,0)
2200File end:
2201fseek(fid,offset,'eof')
2202fseek(fid,offset,1)
2203</MATEX>
2204<SCIEX>
2205File beginning:
2206fseek(offset,fid,"set")
2207Current position:
2208fseek(offset,fid,"cur")
2209File end:
2210fseek(offset,fid,"end")
2211</SCIEX>
2212</MATSCIFUN>
2213
2214<MATSCIFUN>
2215<MATNAME>ftell</MATNAME>
2216<SCINAME>mtell</SCINAME>
2217<DESCR>Get file position indicator</DESCR>
2218</MATSCIFUN>
2219
2220<MATSCIFUN>
2221<MATNAME>full</MATNAME>
2222<SCINAME>full</SCINAME>
2223<DESCR>Convert sparse matrix to full matrix</DESCR>
2224</MATSCIFUN>
2225
2226<MATSCIFUN>
2227<MATNAME>fullfile</MATNAME>
2228<SCINAME>fullfile</SCINAME>
2229<DESCR>Build a full filename from parts</DESCR>
2230</MATSCIFUN>
2231
2232<MATSCIFUN>
2233<MATNAME>fwrite</MATNAME>
2234<SCINAME>No equivalent</SCINAME>
2235<DESCR>Write binary data to a file</DESCR>
2236<NOTE>
2237<P>
2238There is no equivalent function for Matlab <B>fwrite</B> in Scilab but an emulation function has been written: <B>mtlb_fwrite</B>. This function probably not allows all Matlab <B>fwrite</B> possibilities (<B>skip</B> parameter is ignored...).
2239</P>
2240</NOTE>
2241</MATSCIFUN>
2242
2243<MATSCIFUN>
2244<MATNAME>getenv</MATNAME>
2245<SCINAME>getenv</SCINAME>
2246<DESCR>Get environment variable</DESCR>
2247<NOTE>
2248<P>
2249Scilab <B>getenv</B> allows to set the string that will be returned if environment variable we want to get does not exist, but not Matlab function.
2250</P>
2251</NOTE>
2252</MATSCIFUN>
2253
2254<MATSCIFUN>
2255<MATNAME>global</MATNAME>
2256<SCINAME>global</SCINAME>
2257<DESCR>Define a global variable</DESCR>
2258</MATSCIFUN>
2259
2260<MATSCIFUN>
2261<MATNAME>graymon</MATNAME>
2262<SCINAME>No equivalent</SCINAME>
2263<DESCR>Set graphics defaults for gray-scale monitors</DESCR>
2264<NOTE>
2265<P>This Matlab function can be replaced in Scilab by: <B>set(gdf(),"color_map",[0.75,0.5,0.25]'*ones(1,3))</B>.</P>
2266</NOTE>
2267</MATSCIFUN>
2268
2269<MATSCIFUN>
2270<MATNAME>grid</MATNAME>
2271<SCINAME>No equivalent</SCINAME>
2272<DESCR>Grid lines for two- and three-dimensional plots</DESCR>
2273<NOTE>
2274<P>
2275There is no minor grid in Scilab.
2276</P>
2277<P>
2278There is no equivalent function for Matlab <B>grid</B> function in Scilab but it has equivalents:
2279</P>
2280<NOTE_ITEM LABEL="grid on"> may be replaced by <B>set(gca(),"grid",[1 1])</B>
2281</NOTE_ITEM>
2282<NOTE_ITEM LABEL="grid off"> may be replaced by <B>set(gca(),"auto_clear",[-1 -1])</B>
2283</NOTE_ITEM>
2284<NOTE_ITEM LABEL="grid minor"> can be emuled in Scilab by <B>mtlb_hold</B> but all grids are toggled
2285</NOTE_ITEM>
2286<NOTE_ITEM LABEL="grid"> can be emuled in Scilab by <B>mtlb_hold</B>
2287</NOTE_ITEM>
2288<NOTE_ITEM LABEL="grid(axes_handle,'on')"> may be replaced by <B>axes_handle.grid=[1 1]</B>
2289</NOTE_ITEM>
2290<NOTE_ITEM LABEL="grid(axes_handle,'off')"> may be replaced by <B>axes_handle.grid=[-1 -1]</B>
2291</NOTE_ITEM>
2292<NOTE_ITEM LABEL="grid(axes_handle,'minor')"> can be emuled in Scilab by <B>mtlb_hold</B> but all grids are toggled
2293</NOTE_ITEM>
2294<NOTE_ITEM LABEL="grid(axes_handle)"> can be emuled in Scilab by <B>mtlb_hold(axes_handle)</B>
2295</NOTE_ITEM>
2296</NOTE>
2297</MATSCIFUN>
2298
2299<MATSCIFUN>
2300<MATNAME>hankel</MATNAME>
2301<SCINAME>hank</SCINAME>
2302<DESCR>Hankel matrix</DESCR>
2303<NOTE>
2304<P>
2305The main difference between Scilab and Matlab function is that they do not use the same input values to build an Hankel matrix. If in Matlab, you just have to give a column vector (and eventually a row vector), Scilab function requires the size of the Hankel matrix to build and a covariance sequence vector for this matrix. (See syntax below)
2306</P>
2307</NOTE>
2308<MATEX>
2309H1 = hankel(C1)
2310H2 = hankel(C2,R2)
2311</MATEX>
2312<SCIEX>
2313N1 = size(C1,"*");
2314COV1 = [matrix(C1,1,-1),zeros(1,N1)];
2315H1 = hank(N1,N1,COV1);
2316M2 = size(C2,"*");
2317N2 = size(R2,"*");
2318COV2 = [matrix(C2,1,-1),matrix(R2(2:$),1,-1)];
2319H2 = hank(M2,N2,COV2);
2320</SCIEX>
2321</MATSCIFUN>
2322
2323<MATSCIFUN>
2324<MATNAME>help</MATNAME>
2325<SCINAME>help</SCINAME>
2326<DESCR>Display help</DESCR>
2327<NOTE>
2328<P>
2329In Scilab you can not get help on a toolbox, only on a function...
2330</P>
2331<P>
2332Scilab equivalent for Matlab <B>help syntax</B> is <B>help("names")</B>.
2333</P>
2334</NOTE>
2335</MATSCIFUN>
2336
2337<MATSCIFUN>
2338<MATNAME>helpbrowser</MATNAME>
2339<SCINAME>help</SCINAME>
2340<DESCR>Display Help browser for access to full online documentation</DESCR>
2341</MATSCIFUN>
2342
2343<MATSCIFUN>
2344<MATNAME>helpdesk</MATNAME>
2345<SCINAME>help</SCINAME>
2346<DESCR>Display Help browser</DESCR>
2347</MATSCIFUN>
2348
2349<MATSCIFUN>
2350<MATNAME>helpwin</MATNAME>
2351<SCINAME>help</SCINAME>
2352<DESCR>Provide access to and display help for all functions</DESCR>
2353</MATSCIFUN>
2354
2355<MATSCIFUN>
2356<MATNAME>hess</MATNAME>
2357<SCINAME>hess</SCINAME>
2358<DESCR>Hessenberg form of a matrix</DESCR>
2359</MATSCIFUN>
2360
2361<MATSCIFUN>
2362<MATNAME>hold</MATNAME>
2363<SCINAME>No equivalent</SCINAME>
2364<DESCR>Hold current graph</DESCR>
2365<NOTE>
2366<P>
2367There is no equivalent function for Matlab <B>hold</B> function in Scilab but it has equivalents:
2368</P>
2369<NOTE_ITEM LABEL="hold on"> may be replaced by <B>set(gca(),"auto_clear","off")</B>
2370</NOTE_ITEM>
2371<NOTE_ITEM LABEL="hold off"> may be replaced by <B>set(gca(),"auto_clear","on")</B>
2372</NOTE_ITEM>
2373<NOTE_ITEM LABEL="hold"> can be emuled in Scilab by <B>mtlb_hold</B>
2374</NOTE_ITEM>
2375</NOTE>
2376</MATSCIFUN>
2377
2378<MATSCIFUN>
2379<MATNAME>home</MATNAME>
2380<SCINAME>tohome</SCINAME>
2381<DESCR>Move the cursor to the upper left corner of the Command Window</DESCR>
2382<NOTE>
2383<P>
2384Note that Matlab function has no effect in no window mode under Unix/Linux while Scilab one clears the terminal display as if you were using "clear" command.
2385</P>
2386</NOTE>
2387</MATSCIFUN>
2388
2389<MATSCIFUN>
2390<MATNAME>horzcat</MATNAME>
2391<SCINAME>No equivalent</SCINAME>
2392<DESCR>Horizontal concatenation</DESCR>
2393<NOTE>
2394<P>
2395Scilab equivalent for Matlab <B>horzcat(A1,A2,...,An)</B> is <B>[A1,A2,...,An]</B> if all <B>Ai</B> are not character strings, else, Scilab equivalent is <B>A1+A2+...+An</B>.
2396</P>
2397</NOTE>
2398</MATSCIFUN>
2399
2400<MATSCIFUN>
2401<MATNAME>ifft(A[,...])</MATNAME>
2402<SCINAME>fft(A,1[,...])</SCINAME>
2403<DESCR>Inverse discrete Fourier transform</DESCR>
2404<NOTE>
2405<NOTE_ITEM LABEL="Y = ifft(X)">If X is a vector then Scilab equivalent for Matlab <B>ifft(X)</B> is <B>fft(X,1)</B>. If <B>X</B> is a matrix then Scilab equivalent for Matlab <B>ifft(X)</B> is <B>fft(X,1,2,1)</B>.
2406</NOTE_ITEM>
2407<NOTE_ITEM LABEL="Y = ifft(X,n) / Y = ifft(X,n,dim) / Y = ifft(X,[],dim)">There is no Scilab equivalent for all these Matlab uses of <B>ifft</B>, in these cases, use <B>mtlb_ifft</B> instead.
2408</NOTE_ITEM>
2409</NOTE>
2410</MATSCIFUN>
2411
2412<MATSCIFUN>
2413<MATNAME>input</MATNAME>
2414<SCINAME>input</SCINAME>
2415<DESCR>Request user input</DESCR>
2416</MATSCIFUN>
2417
2418<MATSCIFUN>
2419<MATNAME>isa</MATNAME>
2420<SCINAME>No equivalent</SCINAME>
2421<DESCR>Detect an object of a given type</DESCR>
2422<NOTE>
2423<P>
2424There is no equivalent function for Matlab <B>isa</B> function in Scilab but it can be replaced by equivalent syntaxes as shown is examples.
2425</P>
2426</NOTE>
2427<MATEX>
2428a = isa(x,'logical')
2429b = isa(x,'char')
2430c = isa(x,'numeric')
2431d = isa(x,'int8')
2432e = isa(x,'uint8')
2433f = isa(x,'int16')
2434g = isa(x,'uint16')
2435h = isa(x,'int32')
2436k = isa(x,'uint32')
2437l = isa(x,'single')
2438m = isa(x,'double')
2439n = isa(x,'cell')
2440o = isa(x,'struct')
2441p = isa(x,'function_handle')
2442q = isa(x,'sparse')
2443r = isa(x,'lti')
2444</MATEX>
2445<SCIEX>
2446a = type(x)==4;
2447b = type(x)==10;
2448c = or(type(x)==[1,5,8]);
2449d = typeof(x)=="int8";
2450e = typeof(x)=="uint8";
2451f = typeof(x)=="int16";
2452g = typeof(x)=="uint16";
2453h = typeof(x)=="int32";
2454k = typeof(x)=="uint32";
2455l = type(x)==1;
2456m = type(x)==1;
2457n = typeof(x)=="ce";
2458o = typeof(x)=="st";
2459p = type(x)==13;
2460q = type(x)==5;
2461r = typeof(x)=="state-space";
2462</SCIEX>
2463</MATSCIFUN>
2464
2465<MATSCIFUN>
2466<MATNAME>iscell(A)</MATNAME>
2467<SCINAME>typeof(A)=="ce"</SCINAME>
2468<DESCR>Determine if input is a cell array</DESCR>
2469</MATSCIFUN>
2470
2471<MATSCIFUN>
2472<MATNAME>ischar(A)</MATNAME>
2473<SCINAME>type(A)==10</SCINAME>
2474<DESCR>Determine if item is a character array</DESCR>
2475</MATSCIFUN>
2476
2477<MATSCIFUN>
2478<MATNAME>isdir</MATNAME>
2479<SCINAME>isdir</SCINAME>
2480<DESCR>Determine if item is a directory</DESCR>
2481</MATSCIFUN>
2482
2483<MATSCIFUN>
2484<MATNAME>isempty</MATNAME>
2485<SCINAME>isempty</SCINAME>
2486<DESCR>True for empty matrix</DESCR>
2487</MATSCIFUN>
2488
2489<MATSCIFUN>
2490<MATNAME>isequal</MATNAME>
2491<SCINAME>isequal</SCINAME>
2492<DESCR>Determine if arrays are numerically equal</DESCR>
2493<NOTE>
2494<P>
2495In Scilab, struct fields must be in the same order so that structs can be equal but not in Matlab.
2496</P>
2497</NOTE>
2498</MATSCIFUN>
2499
2500<MATSCIFUN>
2501<MATNAME>isfield</MATNAME>
2502<SCINAME>No equivalent</SCINAME>
2503<DESCR>Determine if input is a structure array field</DESCR>
2504<NOTE>
2505<P>
2506There is no Scilab equivalent function for Matlab <B>tf=isfield(A,field)</B> but there are equivalent instructions:
2507</P>
2508<NOTE_ITEM LABEL="If A is not a structure and/or field is not a character string">
2509Scilab equivalent is <B>%F</B>.
2510</NOTE_ITEM>
2511<NOTE_ITEM LABEL="If A is a structure and field is a character string">
2512Scilab equivalent is <B>allfields=getfield(1,A);tf=or(allfields(3:$)==field);</B>.
2513</NOTE_ITEM>
2514</NOTE>
2515</MATSCIFUN>
2516
2517<MATSCIFUN>
2518<MATNAME>isfinite</MATNAME>
2519<SCINAME>No equivalent</SCINAME>
2520<DESCR>True for finite elements</DESCR>
2521<NOTE>
2522<P>
2523There is no equivalent function for Matlab <B>isfinite</B> function in Scilab but it can be emuled by: <B>abs(A)<MATH>&lt;</MATH>%Inf</B>
2524</P>
2525</NOTE>
2526</MATSCIFUN>
2527
2528<MATSCIFUN>
2529<MATNAME>isglobal</MATNAME>
2530<SCINAME>isglobal</SCINAME>
2531<DESCR>Determine if item is a global variable</DESCR>
2532</MATSCIFUN>
2533
2534<MATSCIFUN>
2535<MATNAME>ishandle(A)</MATNAME>
2536<SCINAME>type(A)==9</SCINAME>
2537<DESCR>Determines if values are valid graphics object handles</DESCR>
2538</MATSCIFUN>
2539
2540<MATSCIFUN>
2541<MATNAME>ishold</MATNAME>
2542<SCINAME>No equivalent</SCINAME>
2543<DESCR>Return hold state</DESCR>
2544<NOTE>
2545<P>
2546There is no equivalent function for Matlab <B>ishold</B> function in Scilab but it can be emuled by: <B>get(gca(),"auto_clear")=="off";</B>.
2547</P>
2548</NOTE>
2549</MATSCIFUN>
2550
2551<MATSCIFUN>
2552<MATNAME>isinf</MATNAME>
2553<SCINAME>isinf</SCINAME>
2554<DESCR>True for infinite elements</DESCR>
2555</MATSCIFUN>
2556
2557<MATSCIFUN>
2558<MATNAME>isinteger(A)</MATNAME>
2559<SCINAME>type(A)==8</SCINAME>
2560<DESCR>Detect whether an array has integer data type</DESCR>
2561</MATSCIFUN>
2562
2563<MATSCIFUN>
2564<MATNAME>isletter</MATNAME>
2565<SCINAME>No equivalent</SCINAME>
2566<DESCR>True for letters of the alphabet</DESCR>
2567<NOTE>
2568<P>
2569There is no equivalent function to Matlab <B>isletter</B> function in Scilab. However it can be replaced as follows. Using <B>mtlb_isletter</B> will give a prettier code.
2570</P>
2571</NOTE>
2572<MATEX>
2573tf = isletter(A)
2574</MATEX>
2575<SCIEX>
2576If A is a String matrix:
2577tf = ((asciimat(A)<MATH>&gt;=</MATH>65) &amp; (asciimat(A)<MATH>&lt;=</MATH>90)) <MATH>|</MATH> ((asciimat(A)<MATH>&gt;=</MATH>97) &amp; (asciimat(A)<MATH>&lt;=</MATH>122))
2578If A is not a String matrix:
2579tf = zeros(A)
2580</SCIEX>
2581</MATSCIFUN>
2582
2583<MATSCIFUN>
2584<MATNAME>islogical(A)</MATNAME>
2585<SCINAME>No equivalent</SCINAME>
2586<DESCR>Determine if item is a logical array</DESCR>
2587<NOTE>
2588<P>
2589There is no equivalent function for Matlab <B>islogical</B> function in Scilab but it can be emuled by: <B>or(type(A)==[4,6])</B>.
2590</P>
2591</NOTE>
2592</MATSCIFUN>
2593
2594<MATSCIFUN>
2595<MATNAME>isnan</MATNAME>
2596<SCINAME>isnan</SCINAME>
2597<DESCR>Detect NaN elements of an array</DESCR>
2598</MATSCIFUN>
2599
2600<MATSCIFUN>
2601<MATNAME>isnumeric(A)</MATNAME>
2602<SCINAME>No equivalent</SCINAME>
2603<DESCR>Determine if input is a numeric array</DESCR>
2604<NOTE>
2605<P>
2606There is no equivalent function for Matlab <B>isnumeric</B> function in Scilab but it can be emuled by: <B>or(type(A)==[1 5 8])</B>.
2607</P>
2608</NOTE>
2609</MATSCIFUN>
2610
2611<MATSCIFUN>
2612<MATNAME>ispc</MATNAME>
2613<SCINAME>MSDOS</SCINAME>
2614<DESCR>Determine if PC (Windows) version</DESCR>
2615</MATSCIFUN>
2616
2617<MATSCIFUN>
2618<MATNAME>isreal</MATNAME>
2619<SCINAME>isreal</SCINAME>
2620<DESCR>Determine if all array elements are real numbers</DESCR>
2621<NOTE>
2622<P>
2623Scilab <B>isreal</B> function can take two values as input. The first one is the same as Matlab one and the second allows to give a tolerance on the absolute value of the imaginary part of first input. So to have the same results in Matlab and in Scilab, second input in Scilab function must be set to 0.
2624</P>
2625</NOTE>
2626<MATEX>
2627tf = isreal(1+0i)
2628tf = 1
2629</MATEX>
2630<SCIEX>
2631tf = isreal(1+0*%i)
2632tf = %F
2633tf = isreal(1+0*%i,0)
2634tf = %T
2635</SCIEX>
2636</MATSCIFUN>
2637