summaryrefslogtreecommitdiffstats
path: root/scilab_doc
diff options
context:
space:
mode:
authorMichaŽl Baudin <michael.baudin@scilab.org>2009-09-30 11:33:58 +0200
committerMichaŽl Baudin <michael.baudin@scilab.org>2009-09-30 11:33:58 +0200
commite626b5e5772f611cbafecd7cb57c559a37b0ab42 (patch)
tree3d59914cdf7e3616363ecbfa6b62c031aebff031 /scilab_doc
parent00bde02012a3d3754e2d009f4c7fef14fb36164f (diff)
parentcfc80bebcbf48a15553532734c75279900aa9b09 (diff)
downloadscilab-e626b5e5772f611cbafecd7cb57c559a37b0ab42.zip
scilab-e626b5e5772f611cbafecd7cb57c559a37b0ab42.tar.gz
Merge branch 'master' of git.scilab.org:scilab
Diffstat (limited to 'scilab_doc')
-rw-r--r--scilab_doc/Matlab_Scilab_dictionary/matlabscilab.xml4185
1 files changed, 4185 insertions, 0 deletions
<
diff --git a/scilab_doc/Matlab_Scilab_dictionary/matlabscilab.xml b/scilab_doc/Matlab_Scilab_dictionary/matlabscilab.xml
new file mode 100644
index 0000000..b1a07d5
--- /dev/null
+++ b/scilab_doc/Matlab_Scilab_dictionary/matlabscilab.xml
@@ -0,0 +1,4185 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<refentry version="5.0-subset Scilab" xml:id="matlabscilab" xml:lang="en"
3 xmlns="http://docbook.org/ns/docbook"
4 xmlns:xlink="http://www.w3.org/1999/xlink"
5 xmlns:xi="http://www.w3.org/2001/XInclude"
6 xmlns:svg="http://www.w3.org/2000/svg"
7 xmlns:mml="http://www.w3.org/1998/Math/MathML"
8 xmlns:html="http://www.w3.org/1999/xhtml"
9 xmlns:db="http://docbook.org/ns/docbook">
10 <refnamediv>
11 <refname>From Matlab to Scilab</refname>
12
13 <refpurpose>The things to know when you convert a Matlab script into Scilab.</refpurpose>
14 </refnamediv>
15
16 <refsection>
17 <title>Matlab-Scilab equivalent functions</title>
18 <para> </para>
19 </refsection>
20
21 <refsection>
22 <title>Foreword</title>
23 <para>
24 This document contains a list of some Matlab basis functions and compare them with the Scilab equivalent functions if there are. It gives the main differences and gives examples of particular cases. However not all Matlab and Scilab functions are described here. Equivalents for operators and variables can be found at the end of this document.</para>
25 </refsection>
26
27 <refsection>
28 <title>Caution</title>
29
30 <para>This document is not dedicated to explain how functions work. Users can used online manuals of Matlab and Scilab for it.</para>
31 </refsection>
32
33 <refsection>
34 <title>How to use this guide</title>
35
36 <para>To access a function, click its first letter. Then, if the matlab command is blue, click on it to see some comments.</para>
37
38 <para>Link to the <link linkend="http://www.scilab.org/product/dic-mat-sci/M2SCI_doc.htm">original page</link> on the scilab web site.</para>
39
40 <table>
41 <caption/>
42 <tbody>
43 <tr>
44 <td>
45 <para><emphasis role="strong">Go to</emphasis></para>
46 </td>
47 </tr>
48 <tr>
49 <td>
50 <para><link linkend="table_a">A</link></para>
51 </td>
52 <td>
53 <para><link linkend="table_b">B</link></para>
54 </td>
55 <td>
56 <para><link linkend="table_c">C</link></para>
57 </td>
58 <td>
59 <para><link linkend="table_d">D</link></para>
60 </td>
61 </tr>
62 <tr>
63 <td>
64 <para><link linkend="table_e">E</link></para>
65 </td>
66 <td>
67 <para><link linkend="table_f">F</link></para>
68 </td>
69 <td>
70 <para><link linkend="table_g">G</link></para>
71 </td>
72 <td>
73 <para><link linkend="table_h">H</link></para>
74 </td>
75 </tr>
76 <tr>
77 <td>
78 <para><link linkend="table_i">I</link></para>
79 </td>
80 <td>
81 <para><link linkend="table_j">J</link></para>
82 </td>
83 <td>
84 <para><link linkend="table_k">K</link></para>
85 </td>
86 <td>
87 <para><link linkend="table_l">L</link></para>
88 </td>
89 </tr>
90 <tr>
91 <td>
92 <para><link linkend="table_m">M</link></para>
93 </td>
94 <td>
95 <para><link linkend="table_n">N</link></para>
96 </td>
97 <td>
98 <para><link linkend="table_o">O</link></para>
99 </td>
100 <td>
101 <para><link linkend="table_p">P</link></para>
102 </td>
103 </tr>
104 <tr>
105 <td>
106 <para><link linkend="table_q">Q</link></para>
107 </td>
108 <td>
109 <para><link linkend="table_r">R</link></para>
110 </td>
111 <td>
112 <para><link linkend="table_s">S</link></para>
113 </td>
114 <td>
115 <para><link linkend="table_t">T</link></para>
116 </td>
117 </tr>
118 <tr>
119 <td>
120 <para><link linkend="table_u">U</link></para>
121 </td>
122 <td>
123 <para><link linkend="table_v">V</link></para>
124 </td>
125 <td>
126 <para><link linkend="table_w">W</link></para>
127 </td>
128 <td>
129 <para><link linkend="table_x">X</link></para>
130 </td>
131 </tr>
132 <tr>
133 <td>
134 <para><link linkend="table_y">Y</link></para>
135 </td>
136 <td>
137 <para><link linkend="table_z">Z</link></para>
138 </td>
139 <td>
140 <para><link linkend="table_operators">operators</link></para>
141 </td>
142 <td>
143 <para><link linkend="table_variables">variables</link></para>
144 </td>
145 </tr>
146 <tr>
147 <td>
148 <para><emphasis role="strong">Equivalence table</emphasis></para>
149 </td>
150 </tr>
151 <tr>
152 <td>
153 <para xml:id="table_a">Matlab A</para>
154 </td>
155 </tr>
156 <tr>
157 <td><para> abs </para></td>
158 <td><para> Absolute value and complex magnitude </para></td>
159 <td><para> abs </para></td>
160 </tr>
161 <tr>
162 <td><para>acosh</para></td>
163 <td><para> Inverse hyperbolic cosine </para></td>
164 <td><para> acosh </para></td>
165 </tr>
166 <tr>
167 <td><para> acos </para></td>
168 <td><para> Inverse cosine </para></td>
169 <td><para> acos </para></td>
170 </tr>
171 <tr>
172 <td><para> acoth(A) </para></td>
173 <td><para> Inverse hyperbolic cotangent </para></td>
174 <td><para> atanh((1) ./A) </para></td>
175 </tr>
176 <tr>
177 <td><para> acot(A) </para></td>
178 <td><para> Inverse cotangent </para></td>
179 <td><para> atan((1) ./A) </para></td>
180 </tr>
181 <tr>
182 <td><para> acsch(A) </para></td>
183 <td><para> Inverse hyperbolic cosecant </para></td>
184 <td><para> asinh((1) ./A) </para></td>
185 </tr>
186 <tr>
187 <td><para> acsc(A) </para></td>
188 <td><para> Inverse cosecant </para></td>
189 <td><para> asin((1) ./A) </para></td>
190 </tr>
191 <tr>
192 <td><para><link linkend="all">all </link></para></td>
193 <td><para> Test to determine if all elements are nonzero </para></td>
194 <td><para> and </para></td>
195 </tr>
196 <tr>
197 <td><para> angle(A) </para></td>
198 <td><para> Phase angle </para></td>
199 <td><para> atan(imag(A),real(A)) </para></td>
200 </tr>
201 <tr>
202 <td><para><link linkend="any">any </link></para></td>
203 <td><para> Test to determine if any nonzeros elements </para></td>
204 <td><para> or </para></td>
205 </tr>
206 <tr>
207 <td><para> asech(A) </para></td>
208 <td><para> Inverse hyperbolic secant </para></td>
209 <td><para> acosh((1) ./A) </para></td>
210 </tr>
211 <tr>
212 <td><para> asec(A) </para></td>
213 <td><para> Inverse secant </para></td>
214 <td><para> acos((1) ./A) </para></td>
215 </tr>
216 <tr>
217 <td><para> asinh </para></td>
218 <td><para> Inverse hyperbolic sine </para></td>
219 <td><para> asinh </para></td>
220 </tr>
221 <tr>
222 <td><para><link linkend="asin">asin </link></para></td>
223 <td><para> Inverse sine </para></td>
224 <td><para> asin </para></td>
225 </tr>
226 <tr>
227 <td><para><link linkend="atan2">atan2 </link></para></td>
228 <td><para> Four-quadrant inverse tangent </para></td>
229 <td><para> atan2 </para></td>
230 </tr>
231 <tr>
232 <td><para><link linkend="atanh">atanh </link></para></td>
233 <td><para> Inverse hyperbolic tangent </para></td>
234 <td><para> atanh </para></td>
235 </tr>
236 <tr>
237 <td><para> atan </para></td>
238 <td><para> Two-quadrant inverse tangent </para></td>
239 <td><para> atan </para></td>
240 </tr>
241 <tr>
242 <td>
243 <para xml:id="table_b">Matlab B</para></td>
244 </tr>
245 <tr>
246 <td><para><link linkend="balance">balance </link></para></td>
247 <td><para> Diagonal scaling to improve eigenvalue accuracy </para></td>
248 <td><para> balanc </para></td>
249 </tr>
250 <tr>
251 <td><para> barh </para></td>
252 <td><para> Bar histogram horizontal </para></td>
253 <td><para> barh </para></td>
254 </tr>
255 <tr>
256 <td><para> bar </para></td>
257 <td><para> Bar histogram </para></td>
258 <td><para> bar </para></td>
259 </tr>
260 <tr>
261 <td><para><link linkend="beep">beep </link></para></td>
262 <td><para> Produce a beep sound </para></td>
263 <td><para> beep </para></td>
264 </tr>
265 <tr>
266 <td><para><link linkend="besseli">besseli </link></para></td>
267 <td><para> Modified Bessel functions of the first kind </para></td>
268 <td><para> besseli </para></td>
269 </tr>
270 <tr>
271 <td><para><link linkend="besselj">besselj </link></para></td>
272 <td><para> Bessel functions of the first kind </para></td>
273 <td><para> besselj </para></td>
274 </tr>
275 <tr>
276 <td><para><link linkend="besselk">besselk </link></para></td>
277 <td><para> Modified Bessel functions of the second kind </para></td>
278 <td><para> besselk </para></td>
279 </tr>
280 <tr>
281 <td><para><link linkend="bessely">bessely </link></para></td>
282 <td><para> Bessel functions of the second kind </para></td>
283 <td><para> bessely </para></td>
284 </tr>
285 <tr>
286 <td><para><link linkend="beta">beta </link></para></td>
287 <td><para> Beta function </para></td>
288 <td><para> beta </para></td>
289 </tr>
290 <tr>
291 <td><para> bin2dec </para></td>
292 <td><para> Returns the integer corresponding to a Given binary representation </para></td>
293 <td><para> bin2dec </para></td>
294 </tr>
295 <tr>
296 <td><para> bitand </para></td>
297 <td><para> The AND of two integers </para></td>
298 <td><para> bitand </para></td>
299 </tr>
300 <tr>
301 <td><para> bitcmp </para></td>
302 <td><para> The binary complementary of an integer </para></td>
303 <td><para> bitcmp </para></td>
304 </tr>
305 <tr>
306 <td><para> bitget </para></td>
307 <td><para> Gets the bit of an integer whose the positon is given in the input argument </para></td>
308 <td><para> bitget </para></td>
309 </tr>
310 <tr>
311 <td><para> bitor </para></td>
312 <td><para> The OR of two integers </para></td>
313 <td><para> bitor </para></td>
314 </tr>
315 <tr>
316 <td><para> bitxor </para></td>
317 <td><para> Returns the exclusive OR of two integers </para></td>
318 <td><para> bitxor </para></td>
319 </tr>
320 <tr>
321 <td><para><link linkend="blanks">blanks </link></para></td>
322 <td><para> A string of blanks </para></td>
323 <td><para> No equivalent </para></td>
324 </tr>
325 <tr>
326 <td><para><link linkend="box">box </link></para></td>
327 <td><para> Display axes border </para></td>
328 <td><para> No equivalent </para></td>
329 </tr>
330 <tr>
331 <td><para> break </para></td>
332 <td><para> Terminate execution of a for loop or while loop </para></td>
333 <td><para> break </para></td>
334 </tr>
335 <tr>
336 <td>
337 <para xml:id="table_c">Matlab C</para>
338 </td>
339 </tr>
340 <tr>
341 <td><para><link linkend="case">case </link></para></td>
342 <td><para> Case switch </para></td>
343 <td><para> case </para></td>
344 </tr>
345 <tr>
346 <td><para> cat </para></td>
347 <td><para> Arrays concatenation </para></td>
348 <td><para> cat </para></td>
349 </tr>
350 <tr>
351 <td><para><link linkend="cd">cd </link></para></td>
352 <td><para> Change/get working directory </para></td>
353 <td><para> cd </para></td>
354 </tr>
355 <tr>
356 <td><para> ceil </para></td>
357 <td><para> Round up </para></td>
358 <td><para> ceil </para></td>
359 </tr>
360 <tr>
361 <td><para> cell2mat </para></td>
362 <td><para> Convert a cell array into a matrix </para></td>
363 <td><para> cell2mat </para></td>
364 </tr>
365 <tr>
366 <td><para> cellstr </para></td>
367 <td><para> Convert strings vector (or strings matrix) into a cell of strings </para></td>
368 <td><para> cellstr </para></td>
369 </tr>
370 <tr>
371 <td><para><link linkend="cell">cell </link></para></td>
372 <td><para> Create cell array </para></td>
373 <td><para> cell </para></td>
374 </tr>
375 <tr>
376 <td><para><link linkend="chol">chol </link></para></td>
377 <td><para> Cholesky factorization </para></td>
378 <td><para> chol </para></td>
379 </tr>
380 <tr>
381 <td><para><link linkend="cla">cla </link></para></td>
382 <td><para> Clear current axes </para></td>
383 <td><para> No equivalent </para></td>
384 </tr>
385 <tr>
386 <td><para><link linkend="clc">clc </link></para></td>
387 <td><para> Clear Command Window </para></td>
388 <td><para> clc([nblines]) </para></td>
389 </tr>
390 <tr>
391 <td><para><link linkend="clear">clear </link></para></td>
392 <td><para> Remove items from workspace, freeing up system memory </para></td>
393 <td><para> clear </para></td>
394 </tr>
395 <tr>
396 <td><para><link linkend="clf">clf </link></para></td>
397 <td><para> Clear current figure window </para></td>
398 <td><para> clf </para></td>
399 </tr>
400 <tr>
401 <td><para><link linkend="clock">clock </link></para></td>
402 <td><para> Current time as a date vector </para></td>
403 <td><para> No equivalent </para></td>
404 </tr>
405 <tr>
406 <td><para> closereq </para></td>
407 <td><para> Default figure close request function </para></td>
408 <td><para> delete(gcf()) </para></td>
409 </tr>
410 <tr>
411 <td><para><link linkend="close">close </link></para></td>
412 <td><para> Delete specified figure </para></td>
413 <td><para> close - xdel - delete </para></td>
414 </tr>
415 <tr>
416 <td><para><link linkend="colordef">colordef </link></para></td>
417 <td><para> Set default property values to display different color schemes </para></td>
418 <td><para> No equivalent </para></td>
419 </tr>
420 <tr>
421 <td><para> complex </para></td>
422 <td><para> Returns the complex form corresponding to the given real part and imaginary part </para></td>
423 <td><para> complex </para></td>
424 </tr>
425 <tr>
426 <td><para> conj </para></td>
427 <td><para> Complex conjugate </para></td>
428 <td><para> conj </para></td>
429 </tr>
430 <tr>
431 <td><para> continue </para></td>
432 <td><para> Keyword to pass control to the next iteration of a loop </para></td>
433 <td><para> continue </para></td>
434 </tr>
435 <tr>
436 <td><para><link linkend="conv">conv </link></para></td>
437 <td><para> Convolution </para></td>
438 <td><para> convol </para></td>
439 </tr>
440 <tr>
441 <td><para> cosh </para></td>
442 <td><para> Hyperbolic cosine </para></td>
443 <td><para> cosh </para></td>
444 </tr>
445 <tr>
446 <td><para> cos </para></td>
447 <td><para> Cosine </para></td>
448 <td><para> cos </para></td>
449 </tr>
450 <tr>
451 <td><para> coth </para></td>
452 <td><para> Hyperbolic cotangent </para></td>
453 <td><para> coth </para></td>
454 </tr>
455 <tr>
456 <td><para> cot </para></td>
457 <td><para> Cotangent </para></td>
458 <td><para> cotg </para></td>
459 </tr>
460 <tr>
461 <td><para> cputime </para></td>
462 <td><para> Elapsed CPU time </para></td>
463 <td><para> timer() </para></td>
464 </tr>
465 <tr>
466 <td><para> csch(A) </para></td>
467 <td><para> Hyperbolic cosecant </para></td>
468 <td><para> (1) ./sinh(A) </para></td>
469 </tr>
470 <tr>
471 <td><para> csc(A) </para></td>
472 <td><para> Cosecant </para></td>
473 <td><para> (1) ./sin(A) </para></td>
474 </tr>
475 <tr>
476 <td><para><link linkend="cumprod">cumprod </link></para></td>
477 <td><para> Cumulative product </para></td>
478 <td><para> cumprod </para></td>
479 </tr>
480 <tr>
481 <td><para><link linkend="cumsum">cumsum </link></para></td>
482 <td><para> Cumulative sum </para></td>
483 <td><para> cumsum </para></td>
484 </tr>
485 <tr>
486 <td>
487 <para xml:id="table_d">Matlab D</para>
488 </td>
489 </tr>
490 <tr>
491 <td><para> date </para></td>
492 <td><para> Current date string </para></td>
493 <td><para> date() </para></td>
494 </tr>
495 <tr>
496 <td><para> dec2bin </para></td>
497 <td><para> The binary representation of a decimal number </para></td>
498 <td><para> dec2bin </para></td>
499 </tr>
500 <tr>
501 <td><para><link linkend="dec2hex">dec2hex </link></para></td>
502 <td><para> Decimal to hexadecimal number conversion </para></td>
503 <td><para> dec2hex </para></td>
504 </tr>
505 <tr>
506 <td><para><link linkend="delete">delete </link></para></td>
507 <td><para> Delete files or graphics objects </para></td>
508 <td><para> mdelete - delete </para></td>
509 </tr>
510 <tr>
511 <td><para> det </para></td>
512 <td><para> Determinant </para></td>
513 <td><para> det </para></td>
514 </tr>
515 <tr>
516 <td><para><link linkend="diag">diag </link></para></td>
517 <td><para> Diagonal including or extracting </para></td>
518 <td><para> diag </para></td>
519 </tr>
520 <tr>
521 <td><para><link linkend="diary">diary </link></para></td>
522 <td><para> Save session to a file </para></td>
523 <td><para> diary </para></td>
524 </tr>
525 <tr>
526 <td><para><link linkend="diff">diff </link></para></td>
527 <td><para> Differences and approximate derivatives </para></td>
528 <td><para> diff </para></td>
529 </tr>
530 <tr>
531 <td><para><link linkend="dir">dir </link></para></td>
532 <td><para> Display directory listing </para></td>
533 <td><para> dir </para></td>
534 </tr>
535 <tr>
536 <td><para> display </para></td>
537 <td><para> Overloaded method to display an object </para></td>
538 <td><para> display </para></td>
539 </tr>
540 <tr>
541 <td><para> disp </para></td>
542 <td><para> Display text or array </para></td>
543 <td><para> disp </para></td>
544 </tr>
545 <tr>
546 <td><para><link linkend="docopt">docopt </link></para></td>
547 <td><para> Web browser for UNIX platforms </para></td>
548 <td><para> No equivalent </para></td>
549 </tr>
550 <tr>
551 <td><para> doc </para></td>
552 <td><para> Display online documentation </para></td>
553 <td><para> help </para></td>
554 </tr>
555 <tr>
556 <td><para><link linkend="dos">dos </link></para></td>
557 <td><para> Execute a UNIX command and return result </para></td>
558 <td><para> unix_g </para></td>
559 </tr>
560 <tr>
561 <td><para><link linkend="double">double </link></para></td>
562 <td><para> Conversion to double precision </para></td>
563 <td><para> double </para></td>
564 </tr>
565 <tr>
566 <td><para><link linkend="drawnow">drawnow </link></para></td>
567 <td><para> Complete pending drawing events </para></td>
568 <td><para> No equivalent </para></td>
569 </tr>
570 <tr>
571 <td>
572 <para xml:id="table_e">Matlab E</para>
573 </td>
574 </tr>
575 <tr>
576 <td><para><link linkend="echo">echo </link></para></td>
577 <td><para> Echo lines during execution </para></td>
578 <td><para> mode </para></td>
579 </tr>
580 <tr>
581 <td><para><link linkend="eig">eig </link></para></td>
582 <td><para> Find eigenvalues and eigenvectors </para></td>
583 <td><para> spec - bdiag </para></td>
584 </tr>
585 <tr>
586 <td><para> elseif </para></td>
587 <td><para> Conditionally execute statements </para></td>
588 <td><para> elseif </para></td>
589 </tr>
590 <tr>
591 <td><para> else </para></td>
592 <td><para> Conditionally execute statements </para></td>
593 <td><para> else </para></td>
594 </tr>
595 <tr>
596 <td><para> end </para></td>
597 <td><para> Terminate loops and conditionals </para></td>
598 <td><para> end </para></td>
599 </tr>
600 <tr>
601 <td><para> erfcx </para></td>
602 <td><para> Scaled complementary error function </para></td>
603 <td><para> erfcx </para></td>
604 </tr>
605 <tr>
606 <td><para> erfc </para></td>
607 <td><para> Complementary error function </para></td>
608 <td><para> erfc </para></td>
609 </tr>
610 <tr>
611 <td><para> erf </para></td>
612 <td><para> Error function </para></td>
613 <td><para> erf </para></td>
614 </tr>
615 <tr>
616 <td><para><link linkend="error">error </link></para></td>
617 <td><para> Display error messages </para></td>
618 <td><para> error </para></td>
619 </tr>
620 <tr>
621 <td><para><link linkend="etime">etime </link></para></td>
622 <td><para> Elapsed time </para></td>
623 <td><para> etime </para></td>
624 </tr>
625 <tr>
626 <td><para><link linkend="eval">eval </link></para></td>
627 <td><para> Execute a string containing an instruction/expression </para></td>
628 <td><para> evstr - execstr </para></td>
629 </tr>
630 <tr>
631 <td><para><link linkend="exist">exist </link></para></td>
632 <td><para> Check if a variable or file exists </para></td>
633 <td><para> exist </para></td>
634 </tr>
635 <tr>
636 <td><para> exit </para></td>
637 <td><para> Ends current session </para></td>
638 <td><para> exit </para></td>
639 </tr>
640 <tr>
641 <td><para> expm </para></td>
642 <td><para> Matrix exponential </para></td>
643 <td><para> expm </para></td>
644 </tr>
645 <tr>
646 <td><para> exp </para></td>
647 <td><para> Exponential </para></td>
648 <td><para> exp </para></td>
649 </tr>
650 <tr>
651 <td><para><link linkend="eye">eye </link></para></td>
652 <td><para> Identity matrix </para></td>
653 <td><para> eye </para></td>
654 </tr>
655 <tr>
656 <td>
657 <para xml:id="table_f">Matlab F</para>
658 </td>
659 </tr>
660 <tr>
661 <td><para> factor </para></td>
662 <td><para> Prime numbers decomposition </para></td>
663 <td><para> factor </para></td>
664 </tr>
665 <tr>
666 <td><para><link linkend="false">false </link></para></td>
667 <td><para> False array </para></td>
668 <td><para> No equivalent </para></td>
669 </tr>
670 <tr>
671 <td><para> fclose </para></td>
672 <td><para> Close one or more open files </para></td>
673 <td><para> mclose </para></td>
674 </tr>
675 <tr>
676 <td><para> feof </para></td>
677 <td><para> Test for end-of-file </para></td>
678 <td><para> meof </para></td>
679 </tr>
680 <tr>
681 <td><para><link linkend="ferror">ferror </link></para></td>
682 <td><para> Query about errors in file input or output </para></td>
683 <td><para> mclearerr - merror </para></td>
684 </tr>
685 <tr>
686 <td><para><link linkend="feval">feval </link></para></td>
687 <td><para> Function evaluation </para></td>
688 <td><para> evstr - execstr </para></td>
689 </tr>
690 <tr>
691 <td><para><link linkend="fftshift">fftshift </link></para></td>
692 <td><para> Shift zero-frequency component of discrete Fourier transform to center of spectrum </para></td>
693 <td><para> fftshift </para></td>
694 </tr>
695 <tr>
696 <td><para><link linkend="fft">fft(A[,...])</link></para></td>
697 <td><para> Discrete Fourier transform </para></td>
698 <td><para> fft(A,-1[,...]) </para></td>
699 </tr>
700 <tr>
701 <td><para><link linkend="fgetl">fgetl </link></para></td>
702 <td><para> Read line(s) from file, discard newline character </para></td>
703 <td><para> mgetl </para></td>
704 </tr>
705 <tr>
706 <td><para><link linkend="fgets">fgets </link></para></td>
707 <td><para> Read line from file, keep newline character </para></td>
708 <td><para> fgetstr </para></td>
709 </tr>
710 <tr>
711 <td><para><link linkend="fileparts">fileparts </link></para></td>
712 <td><para> Return filename parts </para></td>
713 <td><para> fileparts </para></td>
714 </tr>
715 <tr>
716 <td><para><link linkend="filesep">filesep </link></para></td>
717 <td><para> Return the directory separator for this platform </para></td>
718 <td><para> No equivalent </para></td>
719 </tr>
720 <tr>
721 <td><para><link linkend="findstr">findstr </link></para></td>
722 <td><para> Find one string within another </para></td>
723 <td><para> No equivalent </para></td>
724 </tr>
725 <tr>
726 <td><para><link linkend="find">find </link></para></td>
727 <td><para> Find indices and values of nonzero elements </para></td>
728 <td><para> find </para></td>
729 </tr>
730 <tr>
731 <td><para> fix </para></td>
732 <td><para> Round towards zero </para></td>
733 <td><para> fix </para></td>
734 </tr>
735 <tr>
736 <td><para><link linkend="fliplr">fliplr(A) </link></para></td>
737 <td><para> Flip matrix in left/right direction </para></td>
738 <td><para> A(:,\$:-1:1) </para></td>
739 </tr>
740 <tr>
741 <td><para> flipud(A) </para></td>
742 <td><para> Flip matrix in up/down direction </para></td>
743 <td><para> A(\$:-1:1,:) </para></td>
744 </tr>
745 <tr>
746 <td><para> floor </para></td>
747 <td><para> Round down </para></td>
748 <td><para> floor </para></td>
749 </tr>
750 <tr>
751 <td><para><link linkend="fopen">fopen </link></para></td>
752 <td><para> Open a file or obtain information about open files </para></td>
753 <td><para> mopen </para></td>
754 </tr>
755 <tr>
756 <td><para><link linkend="format">format </link></para></td>
757 <td><para> Control display format for output </para></td>
758 <td><para> format </para></td>
759 </tr>
760 <tr>
761 <td><para><link linkend="for">for </link></para></td>
762 <td><para> Repeat statements a specific number of times </para></td>
763 <td><para> for </para></td>
764 </tr>
765 <tr>
766 <td><para><link linkend="fprintf">fprintf </link></para></td>
767 <td><para> Write formatted data to file </para></td>
768 <td><para> No equivalent </para></td>
769 </tr>
770 <tr>
771 <td><para><link linkend="fread">fread </link></para></td>
772 <td><para> Read binary data to a file </para></td>
773 <td><para> No equivalent </para></td>
774 </tr>
775 <tr>
776 <td><para> frewind(fid) </para></td>
777 <td><para> Move the file position indicator to the beginning of an open file </para></td>
778 <td><para> mseek('0',fid) </para></td>
779 </tr>
780 <tr>
781 <td><para><link linkend="fscanf">fscanf </link></para></td>
782 <td><para> Read formatted data to file </para></td>
783 <td><para> No equivalent </para></td>
784 </tr>
785 <tr>
786 <td><para><link linkend="fseek">fseek </link></para></td>
787 <td><para> Set file position indicator </para></td>
788 <td><para> mseek </para></td>
789 </tr>
790 <tr>
791 <td><para> ftell </para></td>
792 <td><para> Get file position indicator </para></td>
793 <td><para> mtell </para></td>
794 </tr>
795 <tr>
796 <td><para> fullfile </para></td>
797 <td><para> Build a full filename from parts </para></td>
798 <td><para> fullfile </para></td>
799 </tr>
800 <tr>
801 <td><para> full </para></td>
802 <td><para> Convert sparse matrix to full matrix </para></td>
803 <td><para> full </para></td>
804 </tr>
805 <tr>
806 <td><para> function </para></td>
807 <td><para> Function definition </para></td>
808 <td><para> function </para></td>
809 </tr>
810 <tr>
811 <td><para><link linkend="fwrite">fwrite </link></para></td>
812 <td><para> Write binary data to a file </para></td>
813 <td><para> No equivalent </para></td>
814 </tr>
815 <tr>
816 <td>
817 <para xml:id="table_g">Matlab G</para>
818 </td>
819 </tr>
820 <tr>
821 <td><para> gammaln </para></td>
822 <td><para> Logarithm of gamma function </para></td>
823 <td><para> gammaln </para></td>
824 </tr>
825 <tr>
826 <td><para> gamma </para></td>
827 <td><para> Gamma function </para></td>
828 <td><para> gamma </para></td>
829 </tr>
830 <tr>
831 <td><para><link linkend="getenv">getenv </link></para></td>
832 <td><para> Get environment variable </para></td>
833 <td><para> getenv </para></td>
834 </tr>
835 <tr>
836 <td><para> global </para></td>
837 <td><para> Define a global variable </para></td>
838 <td><para> global </para></td>
839 </tr>
840 <tr>
841 <td><para><link linkend="graymon">graymon </link></para></td>
842 <td><para> Set graphics defaults for gray-scale monitors </para></td>
843 <td><para> No equivalent </para></td>
844 </tr>
845 <tr>
846 <td><para><link linkend="grid">grid </link></para></td>
847 <td><para> Grid lines for two- and three-dimensional plots </para></td>
848 <td><para> No equivalent </para></td>
849 </tr>
850 <tr>
851 <td>
852 <para xml:id="table_h">Matlab H</para>
853 </td>
854 </tr>
855 <tr>
856 <td><para><link linkend="hankel">hankel </link></para></td>
857 <td><para> Hankel matrix </para></td>
858 <td><para> hank </para></td>
859 </tr>
860 <tr>
861 <td><para> helpbrowser </para></td>
862 <td><para> Display Help browser for access to full online documentation </para></td>
863 <td><para> help </para></td>
864 </tr>
865 <tr>
866 <td><para> helpdesk </para></td>
867 <td><para> Display Help browser </para></td>
868 <td><para> help </para></td>
869 </tr>
870 <tr>
871 <td><para> helpwin </para></td>
872 <td><para> Provide access to and display help for all functions </para></td>
873 <td><para> help </para></td>
874 </tr>
875 <tr>
876 <td><para><link linkend="help">help </link></para></td>
877 <td><para> Display help </para></td>
878 <td><para> help </para></td>
879 </tr>
880 <tr>
881 <td><para> hess </para></td>
882 <td><para> Hessenberg form of a matrix </para></td>
883 <td><para> hess </para></td>
884 </tr>
885 <tr>
886 <td><para><link linkend="hold">hold </link></para></td>
887 <td><para> Hold current graph </para></td>
888 <td><para> No equivalent </para></td>
889 </tr>
890 <tr>
891 <td><para><link linkend="home">home </link></para></td>
892 <td><para> Move the cursor to the upper left corner of the Command Window </para></td>
893 <td><para> tohome </para></td>
894 </tr>
895 <tr>
896 <td><para><link linkend="horzcat">horzcat </link></para></td>
897 <td><para> Horizontal concatenation </para></td>
898 <td><para> No equivalent </para></td>
899 </tr>
900 <tr>
901 <td>
902 <para xml:id="table_i">Matlab I</para>
903 </td>
904 </tr>
905 <tr>
906 <td><para><link linkend="ifft">ifft(A[,...])</link></para></td>
907 <td><para> Inverse discrete Fourier transform </para></td>
908 <td><para> fft(A,1[,...]) </para></td>
909 </tr>
910 <tr>
911 <td><para><link linkend="if">if </link></para></td>
912 <td><para> Conditionally execute statements </para></td>
913 <td><para> if </para></td>
914 </tr>
915 <tr>
916 <td><para> imag </para></td>
917 <td><para> Complex imaginary part </para></td>
918 <td><para> imag </para></td>
919 </tr>
920 <tr>
921 <td><para> input </para></td>
922 <td><para> Request user input </para></td>
923 <td><para> input </para></td>
924 </tr>
925 <tr>
926 <td><para><link linkend="int16">int16 </link></para></td>
927 <td><para> Convert to 16-bit signed integer </para></td>
928 <td><para> int16 </para></td>
929 </tr>
930 <tr>
931 <td><para><link linkend="int32">int32 </link></para></td>
932 <td><para> Convert to 32-bit signed integer </para></td>
933 <td><para> int32 </para></td>
934 </tr>
935 <tr>
936 <td><para><link linkend="int8">int8 </link></para></td>
937 <td><para> Convert to 8-bit signed integer </para></td>
938 <td><para> int8 </para></td>
939 </tr>
940 <tr>
941 <td><para><link linkend="interp1">interp1 </link></para></td>
942 <td><para> One_dimension interpolation function </para></td>
943 <td><para> interp1 </para></td>
944 </tr>
945 <tr>
946 <td><para> inv </para></td>
947 <td><para> Matrix inverse </para></td>
948 <td><para> inv </para></td>
949 </tr>
950 <tr>
951 <td><para><link linkend="isa">isa </link></para></td>
952 <td><para> Detect an object of a given type </para></td>
953 <td><para> No equivalent </para></td>
954 </tr>
955 <tr>
956 <td><para> iscell(A) </para></td>
957 <td><para> Determine if input is a cell array </para></td>
958 <td><para> typeof(A)=='ce' </para></td>
959 </tr>
960 <tr>
961 <td><para> ischar(A) </para></td>
962 <td><para> Determine if item is a character array </para></td>
963 <td><para> type(A)==10 </para></td>
964 </tr>
965 <tr>
966 <td><para> isdir </para></td>
967 <td><para> Determine if item is a directory </para></td>
968 <td><para> isdir </para></td>
969 </tr>
970 <tr>
971 <td><para> isempty </para></td>
972 <td><para> True for empty matrix </para></td>
973 <td><para> isempty </para></td>
974 </tr>
975 <tr>
976 <td><para><link linkend="isequal">isequal </link></para></td>
977 <td><para> Determine if arrays are numerically equal </para></td>
978 <td><para> isequal </para></td>
979 </tr>
980 <tr>
981 <td><para><link linkend="isfield">isfield </link></para></td>
982 <td><para> Determine if input is a structure array field </para></td>
983 <td><para> No equivalent </para></td>
984 </tr>
985 <tr>
986 <td><para><link linkend="isfinite">isfinite </link></para></td>
987 <td><para> True for finite elements </para></td>
988 <td><para> No equivalent </para></td>
989 </tr>
990 <tr>
991 <td><para> isglobal </para></td>
992 <td><para> Determine if item is a global variable </para></td>
993 <td><para> isglobal </para></td>
994 </tr>
995 <tr>
996 <td><para> ishandle(A) </para></td>
997 <td><para> Determines if values are valid graphics object handles </para></td>
998 <td><para> type(A)==9 </para></td>
999 </tr>
1000 <tr>
1001 <td><para><link linkend="ishold">ishold </link></para></td>
1002 <td><para> Return hold state </para></td>
1003 <td><para> No equivalent </para></td>
1004 </tr>
1005 <tr>
1006 <td><para> isinf </para></td>
1007 <td><para> True for infinite elements </para></td>
1008 <td><para> isinf </para></td>
1009 </tr>
1010 <tr>
1011 <td><para> isinteger(A) </para></td>
1012 <td><para> Detect whether an array has integer data type </para></td>
1013 <td><para> type(A)==8 </para></td>
1014 </tr>
1015 <tr>
1016 <td><para><link linkend="isletter">isletter </link></para></td>
1017 <td><para> True for letters of the alphabet </para></td>
1018 <td><para> No equivalent </para></td>
1019 </tr>
1020 <tr>
1021 <td><para><link linkend="islogical">islogical(A) </link></para></td>
1022 <td><para> Determine if item is a logical array </para></td>
1023 <td><para> No equivalent </para></td>
1024 </tr>
1025 <tr>
1026 <td><para> isnan </para></td>
1027 <td><para> Detect NaN elements of an array </para></td>
1028 <td><para> isnan </para></td>
1029 </tr>
1030 <tr>
1031 <td><para><link linkend="isnumeric">isnumeric(A) </link></para></td>
1032 <td><para> Determine if input is a numeric array </para></td>
1033 <td><para> No equivalent </para></td>
1034 </tr>
1035 <tr>
1036 <td><para> ispc </para></td>
1037 <td><para> Determine if PC (Windows) version </para></td>
1038 <td><para> MSDOS </para></td>
1039 </tr>
1040 <tr>
1041 <td><para><link linkend="isreal">isreal </link></para></td>
1042 <td><para> Determine if all array elements are real numbers </para></td>
1043 <td><para> isreal </para></td>
1044 </tr>
1045 <tr>
1046 <td><para> isscalar(A) </para></td>
1047 <td><para> Determine if input is scalar </para></td>
1048 <td><para> sum(length(A))==1 </para></td>
1049 </tr>
1050 <tr>
1051 <td><para><link linkend="isspace">isspace </link></para></td>
1052 <td><para> Detect elements that are ASCII white spaces </para></td>
1053 <td><para> No equivalent </para></td>
1054 </tr>
1055 <tr>
1056 <td><para><link linkend="issparse">issparse(S) </link></para></td>
1057 <td><para> Test if matrix is sparse </para></td>
1058 <td><para> No equivalent </para></td>
1059 </tr>
1060 <tr>
1061 <td><para> isstruct(A) </para></td>
1062 <td><para> Determine if input is a structure array </para></td>
1063 <td><para> typeof(A)=='st' </para></td>
1064 </tr>
1065 <tr>
1066 <td><para> isstr(A) </para></td>
1067 <td><para> Determine if item is a character array </para></td>
1068 <td><para> type(A)==10 </para></td>
1069 </tr>
1070 <tr>
1071 <td><para> isunix </para></td>
1072 <td><para> Determine if Unix version </para></td>
1073 <td><para> ~MSDOS </para></td>
1074 </tr>
1075 <tr>
1076 <td><para><link linkend="isvector">isvector </link></para></td>
1077 <td><para> Determine if input is a vector </para></td>
1078 <td><para> No equivalent </para></td>
1079 </tr>
1080 <tr>
1081 <td>
1082 <para xml:id="table_j">Matlab J</para>
1083 </td>
1084 </tr>
1085 <tr>
1086 <td>
1087 <para xml:id="table_k">Matlab K</para>
1088 </td>
1089 </tr>
1090 <tr>
1091 <td><para> keyboard </para></td>
1092 <td><para> Invoke the keyboard in a file </para></td>
1093 <td><para> pause </para></td>
1094 </tr>
1095 <tr>
1096 <td><para> kron(A,B) </para></td>
1097 <td><para> Kronecker tensor product </para></td>
1098 <td><para> A .*. B </para></td>
1099 </tr>
1100 <tr>
1101 <td>
1102 <para xml:id="table_l">Matlab L</para>
1103 </td>
1104 </tr>
1105 <tr>
1106 <td><para><link linkend="length">length(A) </link></para></td>
1107 <td><para> Length of vector </para></td>
1108 <td><para> No equivalent </para></td>
1109 </tr>
1110 <tr>
1111 <td><para><link linkend="linspace">linspace </link></para></td>
1112 <td><para> Linearly spaced vector </para></td>
1113 <td><para> linspace </para></td>
1114 </tr>
1115 <tr>
1116 <td><para><link linkend="load">load </link></para></td>
1117 <td><para> Load workspace variables from disk </para></td>
1118 <td><para> loadmatfile </para></td>
1119 </tr>
1120 <tr>
1121 <td><para> log10 </para></td>
1122 <td><para> Common (base 10) logarithm </para></td>
1123 <td><para> log10 </para></td>
1124 </tr>
1125 <tr>
1126 <td><para><link linkend="log2">log2 </link></para></td>
1127 <td><para> Base 2 logarithm and dissect floating point number </para></td>
1128 <td><para> log2 - frexp </para></td>
1129 </tr>
1130 <tr>
1131 <td><para><link linkend="logical">logical(A) </link></para></td>
1132 <td><para> Convert numeric values to logical </para></td>
1133 <td><para> No equivalent </para></td>
1134 </tr>
1135 <tr>
1136 <td><para> log </para></td>
1137 <td><para> Natural logarithm </para></td>
1138 <td><para> log </para></td>
1139 </tr>
1140 <tr>
1141 <td><para><link linkend="lookfor">lookfor </link></para></td>
1142 <td><para> Search for specified keyword in all help entries </para></td>
1143 <td><para> apropos </para></td>
1144 </tr>
1145 <tr>
1146 <td><para><link linkend="lower">lower(str) </link></para></td>
1147 <td><para> Convert string to lower case </para></td>
1148 <td><para> convstr(str,'u') </para></td>
1149 </tr>
1150 <tr>
1151 <td><para><link linkend="lu">lu </link></para></td>
1152 <td><para> LU matrix factorization </para></td>
1153 <td><para> lu </para></td>
1154 </tr>
1155 <tr>
1156 <td>
1157 <para xml:id="table_m">Matlab M</para>
1158 </td>
1159 </tr>
1160 <tr>
1161 <td><para><link linkend="max">max </link></para></td>
1162 <td><para> Maximum </para></td>
1163 <td><para> max </para></td>
1164 </tr>
1165 <tr>
1166 <td><para><link linkend="min">min </link></para></td>
1167 <td><para> Minimum </para></td>
1168 <td><para> min </para></td>
1169 </tr>
1170 <tr>
1171 <td><para><link linkend="mkdir">mkdir </link></para></td>
1172 <td><para> </para></td>
1173 <td><para> mkdir </para></td>
1174 </tr>
1175 <tr>
1176 <td><para><link linkend="mod">mod </link></para></td>
1177 <td><para> Modulus after division </para></td>
1178 <td><para> pmodulo </para></td>
1179 </tr>
1180 <tr>
1181 <td><para><link linkend="more">more </link></para></td>
1182 <td><para> Display Command Window output one screenful at a time </para></td>
1183 <td><para> lines </para></td>
1184 </tr>
1185 <tr>
1186 <td>
1187 <para xml:id="table_n">Matlab N</para>
1188 </td>
1189 </tr>
1190 <tr>
1191 <td><para><link linkend="nargin">nargin - nargin('fun') </link></para></td>
1192 <td><para> Number of function input arguments </para></td>
1193 <td><para> argn(2) - size(getfield(1,macrovar(fun)),'*') </para></td>
1194 </tr>
1195 <tr>
1196 <td><para><link linkend="nargout">nargout - nargout('fun') </link></para></td>
1197 <td><para> Number of function output arguments </para></td>
1198 <td><para> argn(1) - size(getfield(2,macrovar(fun)),'*') </para></td>
1199 </tr>
1200 <tr>
1201 <td><para><link linkend="ndims">ndims </link></para></td>
1202 <td><para> Number of array dimensions </para></td>
1203 <td><para> No equivalent </para></td>
1204 </tr>
1205 <tr>
1206 <td><para> norm </para></td>
1207 <td><para> Vector and matrix norms </para></td>
1208 <td><para> norm </para></td>
1209 </tr>
1210 <tr>
1211 <td><para><link linkend="num2str">num2str </link></para></td>
1212 <td><para> Number to string conversion </para></td>
1213 <td><para> string - msprintf </para></td>
1214 </tr>
1215 <tr>
1216 <td>
1217 <para xml:id="table_o">Matlab O</para>
1218 </td>
1219 </tr>
1220 <tr>
1221 <td><para><link linkend="ones">ones </link></para></td>
1222 <td><para> Create an array of all ones </para></td>
1223 <td><para> ones </para></td>
1224 </tr>
1225 <tr>
1226 <td><para> otherwise </para></td>
1227 <td><para> Default part of switch/select statement </para></td>
1228 <td><para> else </para></td>
1229 </tr>
1230 <tr>
1231 <td>
1232 <para xml:id="table_p">Matlab P</para>
1233 </td>
1234 </tr>
1235 <tr>
1236 <td><para><link linkend="pause">pause </link></para></td>
1237 <td><para> Halt execution temporarily </para></td>
1238 <td><para> xpause - halt </para></td>
1239 </tr>
1240 <tr>
1241 <td><para> perms </para></td>
1242 <td><para> Array of all permutations of vector components </para></td>
1243 <td><para> perms </para></td>
1244 </tr>
1245 <tr>
1246 <td><para> permute </para></td>
1247 <td><para> Permute the dimensions of an array </para></td>
1248 <td><para> permute </para></td>
1249 </tr>
1250 <tr>
1251 <td><para> pie </para></td>
1252 <td><para> circular graphic </para></td>
1253 <td><para> pie </para></td>
1254 </tr>
1255 <tr>
1256 <td><para><link linkend="plot">plot </link></para></td>
1257 <td><para> Linear 2-D plot </para></td>
1258 <td><para> plot </para></td>
1259 </tr>
1260 <tr>
1261 <td><para><link linkend="pow2">pow2 </link></para></td>
1262 <td><para> Base 2 power and scale floating-point numbers </para></td>
1263 <td><para> No equivalent </para></td>
1264 </tr>
1265 <tr>
1266 <td><para> primes </para></td>
1267 <td><para> Returns the primes numbers included between 1 and given number </para></td>
1268 <td><para> primes </para></td>
1269 </tr>
1270 <tr>
1271 <td><para><link linkend="prod">prod </link></para></td>
1272 <td><para> Product of array elements </para></td>
1273 <td><para> prod </para></td>
1274 </tr>
1275 <tr>
1276 <td>
1277 <para xml:id="table_q">Matlab Q</para>
1278 </td>
1279 </tr>
1280 <tr>
1281 <td><para><link linkend="qr">qr </link></para></td>
1282 <td><para> Orthogonal-triangular decomposition </para></td>
1283 <td><para> qr </para></td>
1284 </tr>
1285 <tr>
1286 <td><para> quit </para></td>
1287 <td><para> Terminate session </para></td>
1288 <td><para> quit </para></td>
1289 </tr>
1290 <tr>
1291 <td>
1292 <para xml:id="table_r">Matlab R</para>
1293 </td>
1294 </tr>
1295 <tr>
1296 <td><para><link linkend="randn">randn(A) </link></para></td>
1297 <td><para> Normally distributed random numbers and arrays </para></td>
1298 <td><para> rand(A,'normal') </para></td>
1299 </tr>
1300 <tr>
1301 <td><para><link linkend="rand">rand(A) </link></para></td>
1302 <td><para> Uniformly distributed random numbers and arrays </para></td>
1303 <td><para> rand(A[,'uniform']) </para></td>
1304 </tr>
1305 <tr>
1306 <td><para><link linkend="rcond">rcond </link></para></td>
1307 <td><para> Matrix reciprocal condition number estimate </para></td>
1308 <td><para> rcond </para></td>
1309 </tr>
1310 <tr>
1311 <td><para><link linkend="realmax">realmax </link></para></td>
1312 <td><para> Largest positive floating-point number </para></td>
1313 <td><para> number_properties('huge') </para></td>
1314 </tr>
1315 <tr>
1316 <td><para><link linkend="realmin">realmin </link></para></td>
1317 <td><para> Smallest positive floating-point number </para></td>
1318 <td><para> number_properties('tiny') </para></td>
1319 </tr>
1320 <tr>
1321 <td><para> real </para></td>
1322 <td><para> Real part of a complex number </para></td>
1323 <td><para> real </para></td>
1324 </tr>
1325 <tr>
1326 <td><para> rem(X,Y) </para></td>
1327 <td><para> Remainder after division </para></td>
1328 <td><para> X-fix(X./Y).*Y </para></td>
1329 </tr>
1330 <tr>
1331 <td><para><link linkend="repmat">repmat </link></para></td>
1332 <td><para> Replicate and tile an array </para></td>
1333 <td><para> No equivalent </para></td>
1334 </tr>
1335 <tr>
1336 <td><para><link linkend="reshape">reshape </link></para></td>
1337 <td><para> Reshape array </para></td>
1338 <td><para> matrix </para></td>
1339 </tr>
1340 <tr>
1341 <td><para> return </para></td>
1342 <td><para> Return to the invoking function </para></td>
1343 <td><para> return </para></td>
1344 </tr>
1345 <tr>
1346 <td><para> round </para></td>
1347 <td><para> Round to nearest integer </para></td>
1348 <td><para> round </para></td>
1349 </tr>
1350 <tr>
1351 <td>
1352 <para xml:id="table_s">Matlab S</para>
1353 </td>
1354 </tr>
1355 <tr>
1356 <td><para><link linkend="save">save </link></para></td>
1357 <td><para> Save workspace variables from disk </para></td>
1358 <td><para> mtlb_save </para></td>
1359 </tr>
1360 <tr>
1361 <td><para> schur </para></td>
1362 <td><para> Schur decomposition </para></td>
1363 <td><para> schur </para></td>
1364 </tr>
1365 <tr>
1366 <td><para><link linkend="setstr">setstr </link></para></td>
1367 <td><para> Set string flag </para></td>
1368 <td><para> ascii </para></td>
1369 </tr>
1370 <tr>
1371 <td><para> sign </para></td>
1372 <td><para> Signum function </para></td>
1373 <td><para> sign </para></td>
1374 </tr>
1375 <tr>
1376 <td><para> sinh </para></td>
1377 <td><para> Hyperbolic sine </para></td>
1378 <td><para> sinh </para></td>
1379 </tr>
1380 <tr>
1381 <td><para> sin </para></td>
1382 <td><para> Sine </para></td>
1383 <td><para> sin </para></td>
1384 </tr>
1385 <tr>
1386 <td><para><link linkend="size">size </link></para></td>
1387 <td><para> Array dimension </para></td>
1388 <td><para> size </para></td>
1389 </tr>
1390 <tr>
1391 <td><para><link linkend="sort">sort </link></para></td>
1392 <td><para> Sort elements in ascending order </para></td>
1393 <td><para> No equivalent </para></td>
1394 </tr>
1395 <tr>
1396 <td><para><link linkend="sparse">sparse </link></para></td>
1397 <td><para> Create sparse matrix </para></td>
1398 <td><para> sparse </para></td>
1399 </tr>
1400 <tr>
1401 <td><para> sqrt </para></td>
1402 <td><para> Square root </para></td>
1403 <td><para> sqrt </para></td>
1404 </tr>
1405 <tr>
1406 <td><para><link linkend="strcmpi">strcmpi(str1,str2) </link></para></td>
1407 <td><para> Compare strings ignoring case </para></td>
1408 <td><para> convstr(str1)==convstr(str2) </para></td>
1409 </tr>
1410 <tr>
1411 <td><para><link linkend="strcmp">strcmp(str1,str2) </link></para></td>
1412 <td><para> Compare strings </para></td>
1413 <td><para> str1==str2 </para></td>
1414 </tr>
1415 <tr>
1416 <td><para><link linkend="strfind">strfind </link></para></td>
1417 <td><para> Find one string within another </para></td>
1418 <td><para> strindex </para></td>
1419 </tr>
1420 <tr>
1421 <td><para><link linkend="strrep">strrep </link></para></td>
1422 <td><para> String search and replace </para></td>
1423 <td><para> strsubst </para></td>
1424 </tr>
1425 <tr>
1426 <td><para> struct </para></td>
1427 <td><para> Create struct array </para></td>
1428 <td><para> struct </para></td>
1429 </tr>
1430 <tr>
1431 <td><para><link linkend="sum">sum </link></para></td>
1432 <td><para> Sum of array elements </para></td>
1433 <td><para> sum </para></td>
1434 </tr>
1435 <tr>
1436 <td><para><link linkend="surf">surf </link></para></td>
1437 <td><para> 3-D surface plot </para></td>
1438 <td><para> surf </para></td>
1439 </tr>
1440 <tr>
1441 <td><para> svd </para></td>
1442 <td><para> Singular value decomposition </para></td>
1443 <td><para> svd </para></td>
1444 </tr>
1445 <tr>
1446 <td><para> switch </para></td>
1447 <td><para> Switch among several cases based on expression </para></td>
1448 <td><para> select </para></td>
1449 </tr>
1450 <tr>
1451 <td>
1452 <para xml:id="table_t">Matlab T</para>
1453 </td>
1454 </tr>
1455 <tr>
1456 <td><para> tanh </para></td>
1457 <td><para> Hyperbolic tangent </para></td>
1458 <td><para> tanh </para></td>
1459 </tr>
1460 <tr>
1461 <td><para> tan </para></td>
1462 <td><para> Tangent </para></td>
1463 <td><para> tan </para></td>
1464 </tr>
1465 <tr>
1466 <td><para><link linkend="tic">tic </link></para></td>
1467 <td><para> Starts a stopwatch timer </para></td>
1468 <td><para> tic() </para></td>
1469 </tr>
1470 <tr>
1471 <td><para> title </para></td>
1472 <td><para> Display a title on a graphic window </para></td>
1473 <td><para> title </para></td>
1474 </tr>
1475 <tr>
1476 <td><para><link linkend="toc">toc </link></para></td>
1477 <td><para> Read the stopwatch timer </para></td>
1478 <td><para> toc() </para></td>
1479 </tr>
1480 <tr>
1481 <td><para><link linkend="toeplitz">toeplitz </link></para></td>
1482 <td><para> Toeplitz matrix </para></td>
1483 <td><para> toeplitz </para></td>
1484 </tr>
1485 <tr>
1486 <td><para><link linkend="tril">tril </link></para></td>
1487 <td><para> Lower triangular part of a matrix </para></td>
1488 <td><para> tril </para></td>
1489 </tr>
1490 <tr>
1491 <td><para><link linkend="triu">triu </link></para></td>
1492 <td><para> Upper triangular part of a matrix </para></td>
1493 <td><para> triu </para></td>
1494 </tr>
1495 <tr>
1496 <td><para><link linkend="true">true </link></para></td>
1497 <td><para> True array </para></td>
1498 <td><para> No equivalent </para></td>
1499 </tr>
1500 <tr>
1501 <td><para><link linkend="type">type </link></para></td>
1502 <td><para> List file </para></td>
1503 <td><para> No equivalent </para></td>
1504 </tr>
1505 <tr>
1506 <td>
1507 <para xml:id="table_u">Matlab U</para>
1508 </td>
1509 </tr>
1510 <tr>
1511 <td><para> uigetdir </para></td>
1512 <td><para> Standard dialog box for selecting a directory </para></td>
1513 <td><para> tk_getdir </para></td>
1514 </tr>
1515 <tr>
1516 <td><para><link linkend="uint16">uint16 </link></para></td>
1517 <td><para> Convert to 16-bit unsigned integer </para></td>
1518 <td><para> uint16 </para></td>
1519 </tr>
1520 <tr>
1521 <td><para><link linkend="uint32">uint32 </link></para></td>
1522 <td><para> Convert to 32-bit unsigned integer </para></td>
1523 <td><para> uint32 </para></td>
1524 </tr>
1525 <tr>
1526 <td><para><link linkend="uint8">uint8 </link></para></td>
1527 <td><para> Convert to 8-bit unsigned integer </para></td>
1528 <td><para> uint8 </para></td>
1529 </tr>
1530 <tr>
1531 <td><para><link linkend="unix">unix </link></para></td>
1532 <td><para> Execute a UNIX command and return result </para></td>
1533 <td><para> unix_g </para></td>
1534 </tr>
1535 <tr>
1536 <td><para><link linkend="upper">upper(str) </link></para></td>
1537 <td><para> Convert string to upper case </para></td>
1538 <td><para> convstr(str,'u') </para></td>
1539 </tr>
1540 <tr>
1541 <td>
1542 <para xml:id="table_v">Matlab V</para>
1543 </td>
1544 </tr>
1545 <tr>
1546 <td><para><link linkend="varargin">varargin </link></para></td>
1547 <td><para> Pass variable numbers of arguments </para></td>
1548 <td><para> varargin </para></td>
1549 </tr>
1550 <tr>
1551 <td><para><link linkend="varargout">varargout </link></para></td>
1552 <td><para> Return variable numbers of arguments </para></td>
1553 <td><para> varargout </para></td>
1554 </tr>
1555 <tr>
1556 <td><para><link linkend="vertcat">vertcat </link></para></td>
1557 <td><para> Vertical concatenation </para></td>
1558 <td><para> No equivalent </para></td>
1559 </tr>
1560 <tr>
1561 <td>
1562 <para xml:id="table_w">Matlab W</para>
1563 </td>
1564 </tr>
1565 <tr>
1566 <td><para><link linkend="waitforbuttonpress">waitforbuttonpress </link></para></td>
1567 <td><para> Wait for key or mouse button press </para></td>
1568 <td><para> No equivalent </para></td>
1569 </tr>
1570 <tr>
1571 <td><para><link linkend="warning">warning </link></para></td>
1572 <td><para> Display warning messages </para></td>
1573 <td><para> warning </para></td>
1574 </tr>
1575 <tr>
1576 <td><para> while </para></td>
1577 <td><para> Repeat statements an indefinite number of times </para></td>
1578 <td><para> while </para></td>
1579 </tr>
1580 <tr>
1581 <td><para><link linkend="whos">whos </link></para></td>
1582 <td><para> List variables in the workspace </para></td>
1583 <td><para> whos </para></td>
1584 </tr>
1585 <tr>
1586 <td><para><link linkend="who">who </link></para></td>
1587 <td><para> List variables in the workspace </para></td>
1588 <td><para> who </para></td>
1589 </tr>
1590 <tr>
1591 <td><para><link linkend="winqueryreg">winqueryreg </link></para></td>
1592 <td><para> Get item from Microsoft Windows registry </para></td>
1593 <td><para> winqueryreg </para></td>
1594 </tr>
1595 <tr>
1596 <td>
1597 <para xml:id="table_x">Matlab X</para>
1598 </td>
1599 </tr>
1600 <tr>
1601 <td><para> xlabel </para></td>
1602 <td><para> Display a string along the x axis </para></td>
1603 <td><para> xlabel </para></td>
1604 </tr>
1605 <tr>
1606 <td>
1607 <para xml:id="table_y">Matlab Y</para>
1608 </td>
1609 </tr>
1610 <tr>
1611 <td><para> ylabel </para></td>
1612 <td><para> Display a string along the y axis </para></td>
1613 <td><para> ylabel </para></td>
1614 </tr>
1615 <tr>
1616 <td>
1617 <para xml:id="table_z">Matlab Z</para>
1618 </td>
1619 </tr>
1620 <tr>
1621 <td><para><link linkend="zeros">zeros </link></para></td>
1622 <td><para> Create an array of all zeros </para></td>
1623 <td><para> zeros </para></td>
1624 </tr>
1625 <tr>
1626 <td><para> zlabel </para></td>
1627 <td><para> Display a string along the z axis </para></td>
1628 <td><para> zlabel </para></td>
1629 </tr>
1630 <tr>
1631 <td>
1632 <para xml:id="table_operators">Matlab Operators</para>
1633 </td>
1634 </tr>
1635 <tr>
1636 <td><para><link linkend="colon">: </link></para></td>
1637 <td><para> Colon </para></td>
1638 <td><para> : </para></td>
1639 </tr>
1640 <tr>
1641 <td><para><link linkend="plus">+ </link></para></td>
1642 <td><para> Plus </para></td>
1643 <td><para> + </para></td>
1644 </tr>
1645 <tr>
1646 <td><para><link linkend="minus">- </link></para></td>
1647 <td><para> Minus </para></td>
1648 <td><para> - </para></td>
1649 </tr>
1650 <tr>
1651 <td><para> * </para></td>
1652 <td><para> Multiplication </para></td>
1653 <td><para> * </para></td>
1654 </tr>
1655 <tr>
1656 <td><para> / </para></td>
1657 <td><para> Right division </para></td>
1658 <td><para> / </para></td>
1659 </tr>
1660 <tr>
1661 <td><para><link linkend="left_division">\ </link></para></td>
1662 <td><para> Left division </para></td>
1663 <td><para> \ </para></td>
1664 </tr>
1665 <tr>
1666 <td><para> == </para></td>
1667 <td><para> Equal to </para></td>
1668 <td><para> == </para></td>
1669 </tr>
1670 <tr>
1671 <td><para><link linkend="elementwise_multiplication">.* </link></para></td>
1672 <td><para> Elementwise multiplication </para></td>
1673 <td><para> .* </para></td>
1674 </tr>
1675 <tr>
1676 <td><para><link linkend="elementwise_right_division">./ </link></para></td>
1677 <td><para> Elementwise right division </para></td>
1678 <td><para> ./ </para></td>
1679 </tr>
1680 <tr>
1681 <td><para><link linkend="elementwise_left_division">.\ </link></para></td>
1682 <td><para> Elementwise left division </para></td>
1683 <td><para> .\ </para></td>
1684 </tr>
1685 <tr>
1686 <td><para><link linkend="elementwise_transpose">.' </link></para></td>
1687 <td><para> Elementwise transpose </para></td>
1688 <td><para> .' </para></td>
1689 </tr>
1690 <tr>
1691 <td><para><link linkend="elementwise_exponent">.^ </link></para></td>
1692 <td><para> Elementwise exponent </para></td>
1693 <td><para> .^ </para></td>
1694 </tr>
1695 <tr>
1696 <td><para><link linkend="transpose">' </link></para></td>
1697 <td><para> Transpose </para></td>
1698 <td><para> ' </para></td>
1699 </tr>
1700 <tr>
1701 <td><para><link linkend="logical_and">&amp; </link></para></td>
1702 <td><para> Logical AND </para></td>
1703 <td><para> &amp; </para></td>
1704 </tr>
1705 <tr>
1706 <td><para><link linkend="logical_or">| </link></para></td>
1707 <td><para> Logical OR </para></td>
1708 <td><para> </para></td>
1709 </tr>
1710 <tr>
1711 <td><para><link linkend="greater_than">> </link></para></td>
1712 <td><para> Greater than </para></td>
1713 <td><para> > </para></td>
1714 </tr>
1715 <tr>
1716 <td><para><link linkend="greater_or_equal_to"> &gt;= </link></para></td>
1717 <td><para> Greater or equal to </para></td>
1718 <td><para> >= </para></td>
1719 </tr>
1720 <tr>
1721 <td><para><link linkend="smaller_than"> &lt; </link></para></td>
1722 <td><para> Smaller than </para></td>
1723 <td><para> &lt; </para></td>
1724 </tr>
1725 <tr>
1726 <td><para><link linkend="smaller_or_equal_to"> &lt;= </link></para></td>
1727 <td><para> Smaller or equal to </para></td>
1728 <td><para> &lt;= </para></td>
1729 </tr>
1730 <tr>
1731 <td><para><link linkend="exponent">^ </link></para></td>
1732 <td><para> Exponent </para></td>
1733 <td><para> ^ </para></td>
1734 </tr>
1735 <tr>
1736 <td><para><link linkend="negation">~ </link></para></td>
1737 <td><para> Negation </para></td>
1738 <td><para> ~ </para></td>
1739 </tr>
1740 <tr>
1741 <td><para> ~= </para></td>
1742 <td><para> Not equal to </para></td>
1743 <td><para> ~= </para></td>
1744 </tr>
1745 <tr>
1746 <td>
1747 <para xml:id="table_variables">Matlab Variables</para>
1748 </td>
1749 </tr>
1750 <tr>
1751 <td><para> ans </para></td>
1752 <td><para> The most recent answer </para></td>
1753 <td><para> ans </para></td>
1754 </tr>
1755 <tr>
1756 <td><para><link linkend="last_index">end (index) </link></para></td>
1757 <td><para> Last index </para></td>
1758 <td><para> \$ </para></td>
1759 </tr>
1760 <tr>
1761 <td><para><link linkend="variable_eps">eps </link></para></td>
1762 <td><para> Floating-point relative accuracy </para></td>
1763 <td><para> %eps </para></td>
1764 </tr>
1765 <tr>
1766 <td><para><link linkend="variable_i">i </link></para></td>
1767 <td><para> Imaginary unit </para></td>
1768 <td><para> %i </para></td>
1769 </tr>
1770 <tr>
1771 <td><para><link linkend="variable_j">j </link></para></td>
1772 <td><para> Imaginary unit </para></td>
1773 <td><para> %i </para></td>
1774 </tr>
1775 <tr>
1776 <td><para><link linkend="variable_pi">pi </link></para></td>
1777 <td><para> Ratio of a circle's circumference to its diameter </para></td>
1778 <td><para> %pi </para></td>
1779 </tr>
1780 </tbody>
1781 </table>
1782 </refsection>
1783
1784
1785
1786<refsection id="acoth">
1787 <title>acoth(A)</title>
1788 <para>
1789 In Matlab y=acoth(x) and Scilab y=atanh(1 ./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. See atanh
1790 </para>
1791</refsection>
1792
1793<refsection id="all">
1794 <title>all</title>
1795 <para>Test to determine if all elements are nonzero </para>
1796 <para>
1797 Matlab <emphasis role="strong">all</emphasis> function can work with complexes, what Scilab <emphasis role="strong">and</emphasis>
1798 can not, so a call to <emphasis role="strong">abs</emphasis> function can be necessary when translating from Matlab to Scilab.
1799 </para>
1800 <para>The Matlab expression <emphasis role="strong">B=all(A)</emphasis> is translated into Scilab by <emphasis role="strong">B=and(A)</emphasis>:</para>
1801 <para>If <emphasis role="strong">A</emphasis> is a matrix, <emphasis role="strong">all(A)</emphasis> is equivalent to
1802 <emphasis role="strong">all(A,1)</emphasis> in Matlab whereas in Scilab <emphasis role="strong">and(A)</emphasis>
1803 is a logical AND of all elements of <emphasis role="strong">A</emphasis>. If <emphasis role="strong">A</emphasis>
1804 is a multidimensional array then Matlab treats the values along the first non-singleton dimension, but Scilab returns logical AND of all elements of
1805 <emphasis role="strong">A</emphasis>.</para>
1806 <para>The Matlab expression <emphasis role="strong">B=all(A,dim)</emphasis> is translated into Scilab by <emphasis role="strong">B=and(A,dim)</emphasis>
1807 :</para>
1808 <para>In Scilab <emphasis role="strong">dim=1</emphasis> is equivalent to <emphasis role="strong">dim=r</emphasis> and
1809 <emphasis role="strong">dim=2</emphasis> is equivalent <emphasis role="strong">dim=c</emphasis>. In Matlab, <emphasis role="strong">dim</emphasis>
1810 can be greater then the number of dimension of <emphasis role="strong">A</emphasis> (in this case, <emphasis role="strong">B=A</emphasis>
1811 ), in Scilab you will get an error message.
1812 </para>
1813
1814 <programlisting role="example"><![CDATA[
1815% Matlab version
1816y = all([1,1,0;1,0,1])
1817y = [1,0,0]
1818y = all([1,1,0;1,0,1],1)
1819y = [1,0,0]
1820 ]]></programlisting>
1821
1822 <programlisting role="example"><![CDATA[
1823// Scilab version
1824y = and([1,1,0;1,0,1])
1825y = %F
1826y = and([1,1,0;1,0,1],1)
1827y = [%T,%F,%F]
1828 ]]></programlisting>
1829
1830</refsection>
1831
1832<refsection id="any">
1833 <title>any</title>
1834 <para>Test to determine if any nonzeros elements </para>
1835 <para>Matlab <emphasis role="strong">any</emphasis> function can work with complexes, what Scilab <emphasis role="strong">or</emphasis>
1836 can not, so a call to <emphasis role="strong">abs</emphasis> function can be necessary when translating from Matlab to Scilab.</para>
1837 <para>Matlab expression B=any(A) translated into Scilab by B=or(A)</para>
1838 <para>If <emphasis role="strong">A</emphasis> is a matrix, <emphasis role="strong">any(A)</emphasis> is equivalent to
1839 <emphasis role="strong">any(A,1)</emphasis> in Matlab whereas in Scilab <emphasis role="strong">or(A)</emphasis>
1840 is a logical OR of all elements of <emphasis role="strong">A</emphasis>. If <emphasis role="strong">A</emphasis>
1841 is a multidimensional array then Matlab treats the values along the first non-singleton dimension, but Scilab returns logical OR of all elements of
1842 <emphasis role="strong">A</emphasis>.</para>
1843 <para>Matlab expression B=any(A,dim) translated into Scilab by B=or(A,dim)</para>
1844 <para>In Scilab <emphasis role="strong">dim=1</emphasis> is equivalent to <emphasis role="strong">dim=r</emphasis> and
1845 <emphasis role="strong">dim=2</emphasis> is equivalent to <emphasis role="strong">dim=c</emphasis>. In Matlab,
1846 <emphasis role="strong">dim</emphasis> can be greater then the number of dimension of <emphasis role="strong">A</emphasis>
1847 (in this case, <emphasis role="strong">B=A</emphasis>), in Scilab you will get an error message.</para>
1848
1849
1850 <programlisting role="example"><![CDATA[
1851% Matlab version
1852y = any([1,1,0;1,0,1])
1853y = [1,1,1]
1854y = any([1,1,0;1,0,1],1)
1855y = [1,1,1]
1856 ]]></programlisting>
1857
1858 <programlisting role="example"><![CDATA[
1859// Scilab version
1860y = or([1,1,0;1,0,1])
1861y = %T
1862y = or([1,1,0;1,0,1],1)
1863y = [%T,%T,%T]
1864 ]]></programlisting>
1865</refsection>
1866
1867<refsection id="asin">
1868 <title>asin</title>
1869 <para>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.</para>
1870
1871 <programlisting role="example"><![CDATA[
1872// Scilab version
1873y = asin(2)
1874y = 1.5708 - 1.3170i
1875 ]]></programlisting>
1876
1877 <programlisting role="example"><![CDATA[
1878// Scilab version
1879 1 y = asin(2)
1880 2 y = 1.5708 + 1.3170i
1881 ]]></programlisting>
1882</refsection>
1883
1884<refsection id="atan2">
1885 <title>atan2</title>
1886 <para>Four-quadrant inverse tangent </para>
1887 <para>Matlab <emphasis role="strong">atan2</emphasis> function can work with complexes (in this case, complex part is ignored), what Scilab
1888 <emphasis role="strong">atan</emphasis> can not.</para>
1889</refsection>
1890
1891<refsection id="atanh">
1892 <title>atanh</title>
1893 <para>Inverse hyperbolic tangent </para>
1894 <para>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.</para>
1895
1896 <programlisting role="example"><![CDATA[
1897% Scilab version
1898y = atanh(2)
1899y = 0.5493 + 1.5708i
1900 ]]></programlisting>
1901
1902 <programlisting role="example"><![CDATA[
1903// Scilab version
1904y = atanh(2)
1905y = 0.5493061 - 1.5707963i
1906 ]]></programlisting>
1907</refsection>
1908
1909<refsection id="balance">
1910 <title>balance</title>
1911 <para>Diagonal scaling to improve eigenvalue accuracy </para>
1912 <para>There is no equivalent for <emphasis role="strong">B=balance(A)</emphasis> in Scilab, <emphasis role="strong">balanc</emphasis>
1913 function does not work with only one output value. When used with two outputs, these functions return value in inverse order.</para>
1914</refsection>
1915
1916<refsection id="beep">
1917 <title>beep</title>
1918 <para>Produce a beep sound </para>
1919 <para>Scilab <emphasis role="strong">beep</emphasis> always returns a value but not Matlab function.</para>
1920</refsection>
1921
1922<refsection id="besseli">
1923 <title>besseli</title>
1924 <para>Modified Bessel functions of the first kind </para>
1925 <para>Scilab <emphasis role="strong">besseli</emphasis>
1926 function can work with only one output argument, but the Matlab function can work with two outputs arguments.</para>
1927
1928 <programlisting role="example"><![CDATA[
1929% Matlab version
1930y = besseli(alpha,x)
1931y = besseli(alpha,x,1)
1932[y,ierr] = besseli(alpha,...)
1933 ]]></programlisting>
1934
1935 <programlisting role="example"><![CDATA[
1936// Scilab version
1937y = besseli(alpha,x)
1938y = besseli(alpha,x,ice),ice = 1 or ice = 2
1939 ]]></programlisting>
1940</refsection>
1941
1942<refsection id="besselj">
1943 <title>besselj</title>
1944 <para>Bessel functions of the first kind </para>
1945 <para>Scilab <emphasis role="strong">besselj</emphasis>
1946 function can work with only one output argument, but the Matlab function can work with two outputs arguments.</para>
1947
1948 <programlisting role="example"><![CDATA[
1949% Matlab version
1950 1 y = besselj(alpha,x)
1951 2 y = besselj(alpha,x,1)
1952 3 [y,ierr] = besselj(alpha,...)
1953 ]]></programlisting>
1954
1955 <programlisting role="example"><![CDATA[
1956// Scilab version
1957y = besselj(alpha,x)
1958y = besselj(alpha,x,ice),ice = 1 or ice = 2
1959 ]]></programlisting>
1960</refsection>
1961
1962<refsection id="besselk">
1963 <title>besselk</title>
1964 <para>Modified Bessel functions of the second kind </para>
1965 <para>Scilab <emphasis role="strong">besselk</emphasis>
1966 function can work with only one output argument, but the Matlab function can work with two outputs arguments.</para>
1967
1968
1969 <programlisting role="example"><![CDATA[
1970% Matlab version
1971y = besselk(alpha,x)
1972y = besselk(alpha,x,1)
1973[y,ierr] = besselk(alpha,...)
1974 ]]></programlisting>
1975
1976 <programlisting role="example"><![CDATA[
1977// Scilab version
1978y = besselk(alpha,x)
1979y = besselk(alpha,x,ice),ice = 1 or ice = 2
1980 ]]></programlisting>
1981</refsection>
1982
1983<refsection id="bessely">
1984 <title>bessely</title>
1985 <para>Bessel functions of the second kind </para>
1986 <para>Scilab <emphasis role="strong">bessely</emphasis>
1987 function can work with only one output argument, but the Matlab function can work with two outputs arguments.</para>
1988
1989 <programlisting role="example"><![CDATA[
1990% Matlab version
1991y = bessely(alpha,x)
1992y = bessely(alpha,x,1)
1993[y,ierr] = bessely(alpha,...)
1994 ]]></programlisting>
1995
1996 <programlisting role="example"><![CDATA[
1997// Scilab version
1998y = bessely(alpha,x)
1999y = bessely(alpha,x,ice),ice = 1 or ice = 2
2000 ]]></programlisting>
2001</refsection>
2002
2003<refsection id="beta">
2004 <title>beta</title>
2005 <para>Beta function </para>
2006 <para>Matlab <emphasis role="strong">beta</emphasis>
2007 function can work with only one scalar input an done not-scalar input parameter, but in Scilab both parameters must have the same size.</para>
2008
2009 <programlisting role="example"><![CDATA[
2010% Matlab version
2011A = 1;
2012B = [1 2 3];
2013Y = beta(A,B);
2014 ]]></programlisting>
2015
2016 <programlisting role="example"><![CDATA[
2017// Scilab version
2018A = 1;
2019B = [1 2 3];
2020// So that A and B have the same size
2021tmp = A;A = B;A(:) = tmp;
2022Y = beta(A,B);
2023 ]]></programlisting>
2024</refsection>
2025
2026
2027<refsection id="blanks">
2028 <title>blanks</title>
2029 <para>A string of blanks </para>
2030 <para>There is no Scilab equivalent function for Matlab box but it can be easyly replaced by Scilab equivalent instructions.</para>
2031
2032 <programlisting role="example"><![CDATA[
2033% Matlab version
2034A = ['xxx' blanks(20) 'yyy'];
2035 ]]></programlisting>
2036
2037 <programlisting role="example"><![CDATA[
2038// Scilab version
2039A = 'xxx'+part(' ',ones(1,20))+'yyy';
2040 ]]></programlisting>
2041</refsection>
2042
2043<refsection id="box">
2044 <title>box</title>
2045 <para>Display axes border </para>
2046 <para>There is no Scilab equivalent function for Matlab box but it can be easyly replaced by Scilab equivalent instructions.</para>
2047 <para>box on box off box box(h,'on') box(h,'off') box(h) </para>
2048
2049 <programlisting role="example"><![CDATA[
2050// Scilab version
2051a = gca();
2052a.box = 'on';
2053a.box = 'off';
2054if a.box=='on' then a.box='off';else a.box='on';end;
2055h.box = 'on';
2056h.box = 'off';
2057if h.box=='on' then h.box='off';else h.box='on';end;
2058 ]]></programlisting>
2059</refsection>
2060
2061<refsection id="case">
2062 <title>case</title>
2063 <para>Case switch </para>
2064 <para>In 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.).</para>
2065</refsection>
2066
2067<refsection id="cd">
2068 <title>cd</title>
2069 <para>Change/get working directory </para>
2070 <para>Note that <emphasis role="strong">cd ..</emphasis> does not work in Scilab, but it does in Matlab. In Scilab you can use
2071 <emphasis role="strong">cd('..')</emphasis> or <emphasis role="strong"> cd ../ </emphasis>. </para>
2072</refsection>
2073
2074<refsection id="cell">
2075 <title>cell</title>
2076 <para>Create cell array </para>
2077 <para>Note 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.</para>
2078</refsection>
2079
2080<refsection id="chol">
2081 <title>chol</title>
2082 <para>Cholesky factorization </para>
2083 <para>Scilab <emphasis role="strong">chol</emphasis> function can only have one output whereas Matlab one can have two ouputs.</para>
2084</refsection>
2085
2086<refsection id="cla">
2087 <title>cla</title>
2088 <para>Clear current axes </para>
2089 <para>cla: Scilab equivalent could be <emphasis role="strong">a = gca();delete(a.children);</emphasis>
2090 but in this case, all current axes children will be deleted because there is no HandleVisibility property in Scilab graphics.</para>
2091 <para>cla reset: Scilab equivalent is <emphasis role="strong">a = gca();delete(a.children);</emphasis>.</para>
2092</refsection>
2093
2094<refsection id="clc">
2095 <title>clc</title>
2096 <para>Clear Command Window </para>
2097 <para>Note that Scilab function allows to clear only a set of lines above the cursor using <emphasis role="strong">clc(nblines)</emphasis>
2098 . Note 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.</para>
2099</refsection>
2100
2101<refsection id="clear">
2102 <title>clear</title>
2103 <para>Remove items from workspace, freeing up system memory.</para>
2104 <para>Scilab and Matlab <emphasis role="strong">clear</emphasis> functions are only equivalent when called using <emphasis role="strong">clear</emphasis>
2105 or <emphasis role="strong">clear name</emphasis>.</para>
2106 <para>clear global ... : Scilab equivalent for Matlab <emphasis role="strong">clear global [name]</emphasis> is
2107 <emphasis role="strong">clearglobal([name])</emphasis>.</para>
2108 <para>clear variables ... : Scilab equivalent for Matlab <emphasis role="strong">clear variables</emphasis> is simply
2109 <emphasis role="strong">clear</emphasis>.</para>
2110 <para>clear keyword ... : For all other keywords, there is no Scilab equivalent for Matlab <emphasis role="strong">clear call</emphasis>.</para>
2111</refsection>
2112
2113<refsection id="clf">
2114 <title>clf</title>
2115 <para>Clear current figure window </para>
2116 <para>clf : In this case, all current figure children will be deleted because there is no HandleVisibility property in Scilab graphics.</para>
2117 <para>fig_handle = clf : Scilab equivalent is be <emphasis role="strong">fig_handle = gcf();clf;</emphasis>.
2118 In this case, all current figure children will be deleted because there is no HandleVisibility property in Scilab graphics.</para>
2119</refsection>
2120
2121<refsection id="clock">
2122 <title>clock</title>
2123 <para>Current time as a date vector </para>
2124 <para>Even if there no equivalent for Matlab <emphasis role="strong">clock</emphasis> in Scilab, it can be emuled as shown in example.</para>
2125
2126 <programlisting role="example"><![CDATA[
2127// Scilab version
2128c = clock
2129w = getdate();
2130w(3:5) = [];
2131w(6) = w(6)+w(7)/1000;
2132c = w(1:6);
2133 ]]> </programlisting>
2134</refsection>
2135
2136<refsection id="close">
2137 <title>close</title>
2138 <para>Delete specified figure </para>
2139 <para>close : If current figure is a uicontrol one, Scilab and Matlab <emphasis role="strong">close</emphasis>
2140 are equivalent. But if current figure is a graphic window, Scilab equivalent for Matlab <emphasis role="strong">close</emphasis> is
2141 <emphasis role="strong">delete(gcf())</emphasis>.</para>
2142 <para>close(h) : If <emphasis role="strong">h</emphasis> is a uicontrol figure, Scilab and Matlab <emphasis role="strong">close(h)</emphasis>
2143 are equivalent. But if <emphasis role="strong">h</emphasis> is a graphic window, Scilab equivalent for Matlab
2144 <emphasis role="strong">close(h)</emphasis> is <emphasis role="strong">delete(h)</emphasis>.</para>
2145 <para>close('all') : Scilab equivalent for Matlab <emphasis role="strong">close('all')</emphasis> is
2146 <emphasis role="strong">xdel(winsid())</emphasis>.</para>
2147 <para>close(name) : There is no Scilab equivalent for Matlab <emphasis role="strong">close(name)</emphasis> however,
2148 <emphasis role="strong">mtlb_close</emphasis> can be an equivalent.</para>
2149 <para>close('all','hidden') : Scilab equivalent for Matlab <emphasis role="strong">close('all','hidden')</emphasis> is
2150 <emphasis role="strong">xdel(winsid())</emphasis> but Scilab kills all figures even if they are hidden.</para>
2151</refsection>
2152
2153<refsection id="colordef">
2154 <title>colordef</title>
2155 <para>Set default property values to display different color schemes </para>
2156 <para>[h = ]mtlb_colordef(color_option) : Scilab equivalent is <emphasis role="strong">fig = gcf();fig.background = -1;[h = fig];</emphasis>
2157 if <emphasis role="strong">color_option</emphasis> is equal to 'black' or 'none' and
2158 <emphasis role="strong">fig = gcf();fig.background = -1;[h = fig];</emphasis> else.</para>
2159 <para>[h = ]mtlb_colordef(fig,color_option) : Considering <emphasis role="strong">fig</emphasis> is a graphics handle, Scilab equivalent is
2160 <emphasis role="strong">fig.background = -1;[h = fig];</emphasis> if <emphasis role="strong">color_option</emphasis>
2161 is equal to 'black' or 'none' and <emphasis role="strong">fig.background = -2;[h = fig];</emphasis> else.</para>
2162 <para>[h = ]mtlb_colordef('new',color_option) : Scilab equivalent is <emphasis role="strong">
2163 fig=scf(max(winsid())+1);fig.background = -1;[h = fig];</emphasis> if <emphasis role="strong">color_option</emphasis>
2164 is equal to 'black' or 'none' and <emphasis role="strong">fig=scf(max(winsid())+1);fig.background = -2;[h = fig];</emphasis>
2165 else.</para>
2166</refsection>
2167
2168<refsection id="conv">
2169 <title>conv</title>
2170 <para>Convolution </para>
2171 <para>Scilab <emphasis role="strong">convol</emphasis> output value is always a row vector while Matlab
2172 <emphasis role="strong">conv</emphasis> output value is a column vector if at least one input is a column vector.
2173 To have a closer result, replace Matlab <emphasis role="strong">conv(A)</emphasis> by
2174 <emphasis role="strong">clean(convol(A))</emphasis> in Scilab.</para>
2175</refsection>
2176
2177<refsection id="cumprod">
2178 <title>cumprod</title>
2179 <para>Cumulative product </para>
2180 <para>C = cumprod(A) : If <emphasis role="strong">A</emphasis> is a matrix, <emphasis role="strong">cumprod(A)</emphasis>
2181 is equivalent to <emphasis role="strong">cumprod(A,1)</emphasis> in Matlab whereas in Scilab <emphasis role="strong">cumprod(A)</emphasis>
2182 gives the cumulative product of all the entries of <emphasis role="strong">A</emphasis>
2183 taken columnwise. Actually, Matlab works on the first non-singleton dimension and Scilab does not.</para>
2184 <para>C = cumprod(A,dim) : Matlab can work with dim greater than number of dimensions of <emphasis role="strong">A</emphasis>
2185 but Scilab can not, in this can use <emphasis role="strong">mtlb_cumprod</emphasis> instead.</para>
2186
2187 <programlisting role="example"><![CDATA[
2188% Matlab version
2189B = cumprod([1,2,3;4,5,6])
2190B = [1,2,3;4,10,18]
2191B = cumprod([1,2,3;4,5,6],1)
2192B = [1,2,3;4,10,18]
2193 ]]></programlisting>
2194
2195 <programlisting role="example"><![CDATA[
2196// Scilab version
2197B = cumprod([1,2,3;4,5,6])
2198B = [1,8,120;4,40,720]
2199B = cumprod([1,2,3;4,5,6],1)
2200B = [1,2,3;4,10,18]
2201 ]]></programlisting>
2202</refsection>
2203
2204<refsection id="cumsum">
2205 <title>cumsum</title>
2206 <para>Cumulative sum </para>
2207 <para>C=cumsum(A) : If A is a matrix, <emphasis role="strong">cumsum(A)</emphasis> is equivalent to
2208 <emphasis role="strong">cumsum(A,1)</emphasis> in Matlab whereas in Scilab <emphasis role="strong">cumsum(A)</emphasis>
2209 gives the cumulative sum of all the entries of <emphasis role="strong">A</emphasis>
2210 taken columnwise. Actually, Matlab works on the first non-singleton dimension and Scilab does not.</para>
2211 <para>C = cumsum(A,dim) : Matlab can work with dim greater than number of dimensions of <emphasis role="strong">A</emphasis>
2212 but Scilab can not, in this can use <emphasis role="strong">mtlb_cumsum</emphasis> instead.</para>
2213
2214 <programlisting role="example"><![CDATA[
2215% Matlab version
2216B = cumsum([1,2,3;4,5,6])
2217B=[1,2,3;5,7,9]
2218B = cumsum([1,2,3;4,5,6],1)
2219B=[1,2,3;5,7,9]
2220 ]]></programlisting>
2221
2222 <programlisting role="example"><![CDATA[
2223// Scilab version
2224B = cumsum([1,2,3;4,5,6])
2225B=[1,7,15;5,12,21]
2226B = cumsum([1,2,3;4,5,6],1)
2227B=[1,2,3;5,7,9]
2228 ]]></programlisting>
2229</refsection>
2230
2231<refsection id="dec2hex">
2232 <title>dec2hex</title>
2233 <para>Decimal to hexadecimal number conversion </para>
2234 <para>Empty matrix input : In Matlab <emphasis role="strong">dec2hex</emphasis> returns <emphasis role="strong">""</emphasis>
2235 when input is <emphasis role="strong">[]</emphasis> but Scilab <emphasis role="strong">dec2hex</emphasis> returns
2236 <emphasis role="strong">[]</emphasis>.</para>
2237 <para>Complex inputs : In Matlab <emphasis role="strong">dec2hex</emphasis> automatically removes complex part of input but not in Scilab.</para>
2238 <para>Two inputs : In Matlab <emphasis role="strong">dec2hex</emphasis> can have two inputs, in Scilab <emphasis role="strong">mtlb_dec2hex</emphasis>
2239 emulates this case.</para>
2240</refsection>
2241
2242<refsection id="delete">
2243 <title>delete</title>
2244 <para>Delete files or graphics objects </para>
2245 <para>Files : When Matlab <emphasis role="strong">delete</emphasis> is used to delete a file, Scilab equivalent is
2246 <emphasis role="strong">mdelete</emphasis>.</para>
2247 <para>Graphics objects : When Matlab <emphasis role="strong">delete</emphasis> is used to delete a graphics object, Scilab equivalent is
2248 <emphasis role="strong">delete</emphasis>. Note that Scilab <emphasis role="strong">delete</emphasis>
2249 can delete a set of graphics handles is its input is a matrix of such objects.</para>
2250</refsection>
2251
2252<refsection id="diag">
2253 <title>diag</title>
2254 <para>Diagonal including or extracting </para>
2255 <para>Due to the fact that strings or not considered in the same way in Matlab and in Scilab, results are not equal if
2256 <emphasis role="strong">A</emphasis> is a string matrix or vector in <emphasis role="strong">diag(A)</emphasis> or
2257 <emphasis role="strong">diag(A,k)</emphasis>. Note that <emphasis role="strong">mtlb_diag</emphasis> can emulate this particularity in Scilab.</para>
2258
2259 <programlisting role="example"><![CDATA[
2260% Matlab version
2261B = diag('str')
2262B = ['s ';' t ';' r']
2263 ]]></programlisting>
2264
2265 <programlisting role="example"><![CDATA[
2266// Scilab version
2267B = diag('str')
2268B = 'str'
2269B = mtlb_diag('str')
2270B = ['s ';' t ';' r']
2271 ]]></programlisting>
2272</refsection>
2273
2274<refsection id="diary">
2275 <title>diary</title>
2276 <para>Save session to a file </para>
2277 <para>When a filename is given to save environment, if this file exists, Scilab returns an error message while Matlab save environment at the
2278 end of existing file (append). Note that <emphasis role="strong">diary on</emphasis> and <emphasis role="strong">diary toggle</emphasis>
2279 exist only in Matlab. The equivalent for Matlab <emphasis role="strong">diary off</emphasis> is <emphasis role="strong">diary(0)</emphasis>
2280 in Scilab.</para>
2281</refsection>
2282
2283<refsection id="diff">
2284 <title>diff</title>
2285 <para>Differences and approximate derivatives </para>
2286 <para>Y = diff(X[,n]) : For this kind of use of <emphasis role="strong">diff</emphasis>
2287 (dim parameter not given), Matlab works on the first non-singleton dimension of <emphasis role="strong">X</emphasis>
2288 what Scilab does not. In this case, Scilab considers dim to be <emphasis role="strong"> '*' </emphasis>
2289 so that diff threats all values of <emphasis role="strong">X</emphasis>, what Matlab does not.</para>
2290 <para>Y = diff(X,n,dim) : If dimension given by <emphasis role="strong">dim</emphasis> reaches 1 before <emphasis role="strong">n</emphasis>
2291 iterations have been done, Matlab switches to next non-singleton dimension, but Scilab does not, use <emphasis role="strong">mtlb_diff</emphasis>
2292 to get equivalent results. When <emphasis role="strong">n</emphasis> is greater than all existing dimensions of
2293 <emphasis role="strong">X</emphasis>, Matlab returns <emphasis role="strong">[]</emphasis> what Scilab may not give for all inputs.</para>
2294</refsection>
2295
2296<refsection id="dir">
2297 <title>dir</title>
2298 <para>Display directory listing </para>
2299 <para>When used in command window, Scilab and Matlab <emphasis role="strong">dir</emphasis> are equivalents.
2300 When result is stored in a value, Matlab returns a struture but Scilab returns a tlist. To get the same result, you can use
2301 <emphasis role="strong">mtlb_dir</emphasis>, note that in this case, hidden files are not get.</para>
2302</refsection>
2303
2304<refsection id="docopt">
2305 <title>docopt</title>
2306 <para>Web browser for UNIX platforms </para>
2307 <para>There no Scilab equivalent function, however, information about Web Browser used can be found using globalvariable
2308 <emphasis role="strong">%browsehelp</emphasis>. Those variables exists under all platforms.</para>
2309</refsection>
2310
2311<refsection id="dos">
2312 <title>dos</title>
2313 <para>Execute a UNIX command and return result </para>
2314 <para>Output values order is inversed in Scilab and in Matlab. In Scilab use <emphasis role="strong">disp</emphasis>
2315 to emulate Matlab <emphasis role="strong">-echo</emphasis> option.</para>
2316
2317 <programlisting role="example"><![CDATA[
2318[status,result] = dos(...)
2319[result,status] = unix_g(...)
2320 ]]></programlisting>
2321</refsection>
2322
2323<refsection id="double">
2324 <title>double</title>
2325 <para>Conversion to double precision </para>
2326 <para>In Matlab, this function returns a Boolean type value for a Boolean input whereas Scilab function returns a Double type value.</para>
2327</refsection>
2328
2329<refsection id="drawnow">
2330 <title>drawnow</title>
2331 <para>Complete pending drawing events </para>
2332 <para>In Scilab, drawing events are executed immediately. Scilab <emphasis role="strong">drawnow</emphasis> is different from Matlab one.</para>
2333</refsection>
2334
2335<refsection id="echo">
2336 <title>echo</title>
2337 <para>Echo lines during execution </para>
2338 <para>Scilab <emphasis role="strong">mode</emphasis> and Matlab <emphasis role="strong">echo</emphasis>
2339 are not exactly equivalents but they both change the information displayed during execution. Scilab <emphasis role="strong">mode</emphasis>
2340 has to be called inside a script or a function but Matlab <emphasis role="strong">echo</emphasis>
2341 can be called from prompt. However, some uses are equivalents such as:</para>
2342 <para>echo : is equivalent to Scilab <emphasis role="strong">mode(abs(mode()-1))</emphasis> for scripts and non-compiled functions</para>
2343 <para>echo on : is equivalent to Scilab <emphasis role="strong">mode(1)</emphasis> for scripts and non-compiled functions</para>
2344 <para>echo off : is equivalent to Scilab <emphasis role="strong">mode(0)</emphasis></para>
2345</refsection>
2346
2347<refsection id="eig">
2348 <title>eig</title>
2349 <para>Find eigenvalues and eigenvectors </para>
2350 <para>eig(A) : Scilab equivalent for <emphasis role="strong">eig(A)</emphasis> is <emphasis role="strong">spec(A)</emphasis>
2351 . Scilab eigen vector matrix can differ from Matlab one.</para>
2352 <para>eig(A,'nobalance') : There is no Scilab equivalent for <emphasis role="strong">'nobalance</emphasis>' option. See examples.</para>
2353 <para>eig(A,B,flag) : There is no Scilab equivalent for <emphasis role="strong">flag</emphasis></para>
2354
2355
2356 <programlisting role="example"><![CDATA[
2357% Matlab version
2358d = eig(A,'balance')
2359[V,D] = eig(A,'balance')
2360d = eig(A,B)
2361[V,D] = eig(A,B)
2362 ]]></programlisting>
2363
2364 <programlisting role="example"><![CDATA[
2365// Scilab version
2366d = spec(A)
2367[V,D] = bdiag(A+%i,1/%eps)
2368[al,be] = spec(A); d = al./be;
2369[al,be,V] = spec(A); D = spec(al./be);
2370 ]]></programlisting>
2371</refsection>
2372
2373<refsection id="error">
2374 <title>error</title>
2375 <para>Display error messages </para>
2376 <para>Scilab <emphasis role="strong">error</emphasis> function can only take one character string as input but Matlab function can
2377 take more than one character string as input and also numerical values.</para>
2378</refsection>
2379
2380<refsection id="etime">
2381 <title>etime</title>
2382 <para>Elapsed time </para>
2383 <para>In Scilab, <emphasis role="strong">etime</emphasis> can be used with 6 and 10 value vectors but Matlab <emphasis role="strong">etime</emphasis>
2384 can only be used with 6 value vectors ([Year Month Day Hour Minute Second]).</para>
2385</refsection>
2386
2387<refsection id="eval">
2388 <title>eval</title>
2389 <para>Execute a string containing an instruction/expression</para>
2390 <para>Expression : When <emphasis role="strong">eval</emphasis> has to execute an expression then Scilab equivalent for
2391 <emphasis role="strong">eval</emphasis> is <emphasis role="strong">evstr</emphasis></para>
2392 <para>Instruction : When <emphasis role="strong">eval</emphasis> has to execute an instruction with just one output value then Scilab equivalent for
2393 <emphasis role="strong">eval</emphasis> is <emphasis role="strong">evstr</emphasis>. If instruction has more than one output value then
2394 <emphasis role="strong">execstr</emphasis> has to be used as follows. When <emphasis role="strong">eval</emphasis> is used with two inputs
2395 then an equivalent can be found in examples below.</para>
2396
2397
2398 <programlisting role="example"><![CDATA[
2399% Matlab version
2400eval('1+1')
2401eval('x=1+1')
2402eval('[d1,d2]=size(1)')
2403[d1,d2]=eval('size(1)')
2404eval('1+1','1+2')
2405 ]]></programlisting>
2406
2407 <programlisting role="example"><![CDATA[
2408// Scilab version
2409evstr('1+1')
2410x = evstr('1+1')
2411execstr('[d1,d2]=size(1)')
2412execstr('[d1,d2]=size(1)')
2413if execstr('1+1','errcatch') then execstr('1+2');end
2414 ]]></programlisting>
2415</refsection>
2416
2417<refsection id="exist">
2418 <title>exist</title>
2419 <para>Check if a variable or file exists </para>
2420 <para>Scilab <emphasis role="strong">exist</emphasis> function only works for variables, not for M-files or else. Scilab
2421 <emphasis role="strong">mtlb_exist</emphasis> function is a partial emulation for Matlab <emphasis role="strong">exist</emphasis>.</para>
2422</refsection>
2423
2424<refsection id="eye">
2425 <title>eye</title>
2426 <para>Identity matrix </para>
2427 <para>Note that in Matlab, <emphasis role="strong">A</emphasis> can contain complex values (in these cases, only real part of
2428 <emphasis role="strong">A</emphasis> is taken in account), what Scilab function do not tolerate.</para>
2429 <para>B=eye(A) : If A is a scalar, then Matlab returns a <emphasis role="strong">A*A</emphasis> identity matrix but in Scilab you get a
2430 <emphasis role="strong">1</emphasis>, use <emphasis role="strong">eye(A,A)</emphasis> to get the same matrix
2431 <emphasis role="strong">B</emphasis>. If <emphasis role="strong">A</emphasis> is a vector, Scilab and Matlab give the same
2432 <emphasis role="strong">B</emphasis>. Finally, if <emphasis role="strong">A</emphasis> is a matrix, in Scilab, <emphasis role="strong">B</emphasis>
2433 will be a matrix having the same size as <emphasis role="strong">A</emphasis> whereas in Matlab, you get an error message.</para>
2434
2435 <programlisting role="example"><![CDATA[
2436// Scilab version
2437B = eye(2)
2438B = [1,0;0,1]
2439B = eye(2,2)
2440B = [1,0;0,1]
2441B = eye([3,3])
2442B = [1,0,0;0,1,0;0,0,1]
2443 ]]></programlisting>
2444
2445 <programlisting role="example"><![CDATA[
2446// Scilab version
2447B = eye(2)
2448B = 1
2449B = eye(2,2)
2450B = [1,0;0,1]
2451B = eye([3,3])
2452B = [1,0]
2453 ]]></programlisting>
2454</refsection>
2455
2456<refsection id="false">
2457 <title>false</title>
2458 <para>False array </para>
2459 <para>To get the same result in Scilab, use: <emphasis role="strong">zeros(...)==1</emphasis>. See <emphasis role="strong">zeros</emphasis>.</para>
2460</refsection>
2461
2462<refsection id="ferror">
2463 <title>ferror</title>
2464 <para>Query about errors in file input or output </para>
2465 <para>ferror(fid) : When Matlab <emphasis role="strong">ferror</emphasis> is called with just one input and one output, then Scilab equivalent is
2466 <emphasis role="strong">merror</emphasis>.</para>
2467 <para>ferror(fid,'clear') : When Matlab <emphasis role="strong">ferror</emphasis>
2468 is called with two inputs and just one output, then Scilab equivalent is <emphasis role="strong">mclearerr</emphasis>
2469 .For all other cases, there no equivalent in Scilab.</para>
2470</refsection>
2471
2472<refsection id="feval">
2473 <title>feval</title>
2474 <para>Function evaluation </para>
2475 <para>One output : In this case Scilab <emphasis role="strong">evstr</emphasis> is an equivalent to <emphasis role="strong">feval</emphasis>
2476 , after modifying inputs such as in examples below.</para>
2477 <para>More than one output : In this case Scilab <emphasis role="strong">execstr</emphasis> is an equivalent to
2478 <emphasis role="strong">feval</emphasis>, after modifying inputs such as in examples below.</para>
2479
2480 <programlisting role="example"><![CDATA[
2481% Matlab version
2482[y1] = feval(@cos,0)
2483[y1,y2] = feval(@size,1)
2484 ]]></programlisting>
2485
2486 <programlisting role="example"><![CDATA[
2487// Scilab version
2488y1 = evstr('cos(0)')
2489execstr('[y1,y2] = size(1)')
2490 ]]></programlisting>
2491</refsection>
2492
2493<refsection id="fftshift">
2494 <title>fftshift</title>
2495 <para>Shift zero-frequency component of discrete Fourier transform to center of spectrum </para>
2496 <para>fftshift(A[,dim]) : Due to the fact that strings or not considered in the same way in Matlab and in Scilab, results are not equal
2497 if A is a string matrix or vector in fftshift(A) or fftshift(A,dim). <emphasis role="strong">mtlb_fftshift</emphasis>
2498 can emulate this particularity in Scilab.</para>
2499 <para>fftshift(A,dim) : In Matlab, <emphasis role="strong">dim</emphasis> can be greater than the number of dimensions of
2500 <emphasis role="strong">A</emphasis> but in Scilab you get an error message in this case. <emphasis role="strong">mtlb_fftshift</emphasis>
2501 can emulate this particularity in Scilab.</para>
2502
2503 <programlisting role="example"><![CDATA[
2504% Matlab version
2505Y = fftshift('str')
2506Y = 'rst'
2507 ]]></programlisting>
2508
2509 <programlisting role="example"><![CDATA[
2510// Scilab version
2511Y = fftshift('str')
2512Y = 'str'
2513Y = mtlb_fftshift('str')
2514Y = 'rst'
2515 ]]></programlisting>
2516</refsection>
2517
2518<refsection id="fft">
2519 <title>fft(A[,...])</title>
2520 <para>Discrete Fourier transform </para>
2521 <para>Y = fft(X) : If X is a vector then Scilab equivalent for Matlab <emphasis role="strong">fft(X)</emphasis> is
2522 <emphasis role="strong">fft(X,-1)</emphasis>. If <emphasis role="strong">X</emphasis> is a matrix then Scilab equivalent for Matlab
2523 <emphasis role="strong">fft(X)</emphasis> is <emphasis role="strong">fft(X,-1,2,1)</emphasis>.</para>
2524 <para>Y = fft(X,n) / Y = fft(X,n,dim) / Y = fft(X,[],dim) : There is no Scilab equivalent for all these Matlab uses of
2525 <emphasis role="strong">fft</emphasis>, in these cases, use <emphasis role="strong">mtlb_fft</emphasis> instead.</para>
2526</refsection>
2527
2528<refsection id="fgetl">
2529 <title>fgetl</title>
2530 <para>Read line(s) from file, discard newline character </para>
2531 <para>Matlab <emphasis role="strong">fgetl</emphasis> reads file line per line while Scilab <emphasis role="strong">mgetl</emphasis>
2532 allows to read the whole file. Matlab <emphasis role="strong">fgetl</emphasis> returns <emphasis role="strong">-1</emphasis>
2533 if it could not read a line in file but Scilab <emphasis role="strong">mgetl</emphasis> returns an empty string is this case. You can used
2534 <emphasis role="strong">meof</emphasis> to check if End Of File has been reached.</para>
2535</refsection>
2536
2537<refsection id="fgets">
2538 <title>fgets</title>
2539 <para>Read line from file, keep newline character </para>
2540 <para>Input parameter order is inversed in Scilab compared to Matlab.</para>
2541
2542 <programlisting role="example"><![CDATA[
2543% Matlab version
2544fgets(fid,n)
2545 ]]></programlisting>
2546
2547 <programlisting role="example"><![CDATA[
2548// Scilab version
2549fgetstr(n,fid)
2550 ]]></programlisting>
2551</refsection>
2552
2553<refsection id="fileparts">
2554 <title>fileparts</title>
2555 <para>Return filename parts </para>
2556 <para>Scilab function does not get file version but Matlab one does. Scilab function can take a second input parameter specifying the output value we want to get saying: 'path', 'fname' or 'extension'.</para>
2557</refsection>
2558
2559<refsection id="filesep">
2560 <title>filesep</title>
2561 <para>Return the directory separator for this platform </para>
2562 <para>There is no Scilab function equivalent to Matlab <emphasis role="strong">filesep</emphasis> but the same output can be obtained with
2563 <emphasis role="strong">pathconvert('/')</emphasis>.</para>
2564</refsection>
2565
2566<refsection id="findstr">
2567 <title>findstr</title>
2568 <para>Find one string within another </para>
2569 <para>There is no equivalent for <emphasis role="strong">findstr</emphasis> in Scilab, but an emulation function has been written:
2570 <emphasis role="strong">mtlb_findstr</emphasis>. Scilab <emphasis role="strong">strindex</emphasis> function is very similar to
2571 <emphasis role="strong">findstr</emphasis> but do not consider the size of the strings passed as parameters.
2572 <emphasis role="strong">strindex</emphasis> can replace <emphasis role="strong">findstr</emphasis> only if
2573 <emphasis role="strong">findstr</emphasis> can be replaced by <emphasis role="strong">strfind</emphasis> in Matlab.</para>
2574</refsection>
2575
2576<refsection id="find">
2577 <title>find</title>
2578 <para>Find indices and values of nonzero elements </para>
2579 <para>Matlab function can work with complex values what is not possible in Scilab, however, using <emphasis role="strong">abs</emphasis>
2580 it is very easy to have the same results. Note that Scilab function can only return two output values and Matlab one can return a third
2581 value that can be computed according to the first two output matrices as explained in Matlab help. For example, in
2582 <emphasis role="strong">[i,j,v]=find(X)</emphasis>, <emphasis role="strong">v</emphasis> is equal to:
2583 <emphasis role="strong">X(i+(j-1))*size(X,1)</emphasis>. Another great difference between Scilab and Matlab is that Matlab returns column
2584 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
2585 the same output value...what is done mtlb_find()</para>
2586</refsection>
2587
2588<refsection id="fliplr">
2589 <title>fliplr(A)</title>
2590 <para>Flip matrix in left/right direction </para>
2591 <para>Due to the fact that Scilab and Matlab do not consider character string in the same way, result is different for this kind of
2592 input, in this case, use <emphasis role="strong">mtlb_fliplr</emphasis> instead.</para>
2593</refsection>
2594
2595<refsection id="fopen">
2596 <title>fopen</title>
2597 <para>Open a file or obtain information about open files </para>
2598 <para>Access permission : Matlab offers two permissions options not supported by Scilab: <emphasis role="strong">W</emphasis> and
2599 <emphasis role="strong">A</emphasis> (for tape drives)</para>
2600 <para>Input values : In Matlab, <emphasis role="strong">fopen('all')</emphasis> lists all opened files, in Scilab, this type of call for
2601 <emphasis role="strong">fopen</emphasis> does not exist. You can also use <emphasis role="strong">fopen</emphasis> in Matlab to get
2602 informations on a file identifier (<emphasis role="strong">fopen(fid)</emphasis>), this case is not implemented in Scilab.</para>
2603 <para>Machine format : Note that Scilab does not support machine format values as input or output.Matlab <emphasis role="strong">fopen</emphasis>
2604 can return an error message but not Scilab <emphasis role="strong">mopen</emphasis>, moreover, returned file identifier is
2605 <emphasis role="strong">-1</emphasis> in case of error in Matlab but does not exist in this case in Scilab, so an emulation function has
2606 been written <emphasis role="strong">mtlb_fopen</emphasis>.</para>
2607</refsection>
2608
2609<refsection id="format">
2610 <title>format</title>
2611 <para>Control display format for output Some Matlab formats have no Scilab equivalent, see examples below.</para>
2612
2613 <table>
2614 <caption/>
2615 <tbody>
2616 <tr>
2617 <td>
2618 <para><emphasis role="strong">Equivalence table</emphasis></para>
2619 </td>
2620 </tr>
2621 <tr>
2622 <td><para> Matlab </para></td>
2623 <td><para> Scilab </para></td>
2624 </tr>
2625 <tr>
2626 <td><para> format </para></td>
2627 <td><para> format('v',6) </para></td>
2628 </tr>
2629 <tr>
2630 <td><para> format + </para></td>
2631 <td><para> format(6) </para></td>
2632 </tr>
2633 <tr>
2634 <td><para> format bank </para></td>
2635 <td><para> No equivalent for: format 'bank' </para></td>
2636 </tr>
2637 <tr>
2638 <td><para> format compact </para></td>
2639 <td><para> No equivalent for: format 'compact' </para></td>
2640 </tr>
2641 <tr>
2642 <td><para> format hex </para></td>
2643 <td><para> No equivalent for: format 'hex' </para></td>
2644 </tr>
2645 <tr>
2646 <td><para> format long </para></td>
2647 <td><para> format(16) </para></td>
2648 </tr>
2649 <tr>
2650 <td><para> format long e </para></td>
2651 <td><para> format('e',16) </para></td>
2652 </tr>
2653 <tr>
2654 <td><para> format long g </para></td>
2655 <td><para> format('e',16) </para></td>
2656 </tr>
2657 <tr>
2658 <td><para> format loose </para></td>
2659 <td><para> No equivalent for: format 'loose' </para></td>
2660 </tr>
2661 <tr>
2662 <td><para> format rat </para></td>
2663 <td><para> No equivalent for: format 'rat' </para></td>
2664 </tr>
2665 <tr>
2666 <td><para> format short </para></td>
2667 <td><para> format(6) </para></td>
2668 </tr>
2669 <tr>
2670 <td><para> format short e </para></td>
2671 <td><para> format('e',6) </para></td>
2672 </tr>
2673 <tr>
2674 <td><para> format short g </para></td>
2675 <td><para> format('e',6) </para></td>
2676 </tr>
2677 </tbody>
2678 </table>
2679</refsection>
2680
2681<refsection id="for">
2682 <title>for</title>
2683 <para>Repeat statements a specific number of times </para>
2684 <para>The variable used as loop index is clear in Scilab if all iterations have been made but is not clear if loop is ended by a break.
2685 In Matlab, this variable is never cleared.</para>
2686</refsection>
2687
2688<refsection id="fprintf">
2689 <title>fprintf</title>
2690 <para>Write formatted data to file </para>
2691 <para>There is no equivalent function for Matlab <emphasis role="strong">fprintf</emphasis> in Scilab but an emulation function has been written:
2692 <emphasis role="strong">mtlb_fprintf</emphasis>. This function probably not allows all Matlab <emphasis role="strong">fprintf</emphasis>
2693 possibilities.</para>
2694</refsection>
2695
2696<refsection id="fread">
2697 <title>fread</title>
2698 <para>Read binary data to a file </para>
2699 <para>There is no equivalent function for Matlab <emphasis role="strong">fread</emphasis> in Scilab but an emulation function has been written:
2700 <emphasis role="strong">mtlb_fread</emphasis>. This function probably not allows all Matlab <emphasis role="strong">fread</emphasis>
2701 possibilities (<emphasis role="strong">skip</emphasis> parameter is ignored...).</para>
2702</refsection>
2703
2704<refsection id="fscanf">
2705 <title>fscanf</title>
2706 <para>Read formatted data to file </para>
2707 <para>There is no equivalent function for Matlab <emphasis role="strong">fscanf</emphasis> in Scilab but an emulation function has been written:
2708 <emphasis role="strong">mtlb_fscanf</emphasis>. This function probably not allows all Matlab <emphasis role="strong">fscanf</emphasis>
2709 possibilities.</para>
2710</refsection>
2711
2712<refsection id="fseek">
2713 <title>fseek</title>
2714 <para>Set file position indicator </para>
2715 <para>Scilab and Matlab functions differ by the flag which indicate the origin of the position indicator, see examples below.
2716 Note that order of input value is different.</para>
2717
2718 <programlisting role="example"><![CDATA[
2719% Matlab version
2720% File beginning:
2721fseek(fid,offset,'bof')
2722fseek(fid,offset,-1)
2723% Current position:
2724fseek(fid,offset,'cof')
2725fseek(fid,offset,0)
2726% File end:
2727fseek(fid,offset,'eof')
2728fseek(fid,offset,1)
2729 ]]></programlisting>
2730
2731 <programlisting role="example"><![CDATA[
2732// Scilab version
2733// File beginning:
2734fseek(offset,fid,'set')
2735// Current position:
2736fseek(offset,fid,'cur')
2737// File end:
2738fseek(offset,fid,'end')
2739 ]]></programlisting>
2740</refsection>
2741
2742<refsection id="fwrite">
2743 <title>fwrite</title>
2744 <para>Write binary data to a file </para>
2745 <para>There is no equivalent function for Matlab <emphasis role="strong">fwrite</emphasis> in Scilab but an emulation function has been written:
2746 <emphasis role="strong">mtlb_fwrite</emphasis>. This function probably not allows all Matlab <emphasis role="strong">fwrite</emphasis>
2747 possibilities (<emphasis role="strong">skip</emphasis> parameter is ignored...).</para>
2748</refsection>
2749
2750<refsection id="getenv">
2751 <title>getenv</title>
2752 <para>Get environment variable </para>
2753 <para>Scilab <emphasis role="strong">getenv</emphasis> allows to set the string that will be returned if environment variable we want to
2754 get does not exist, but not Matlab function.</para>
2755</refsection>
2756
2757<refsection id="graymon">
2758 <title>graymon</title>
2759 <para>Set graphics defaults for gray-scale monitors </para>
2760 <para>This Matlab function can be replaced in Scilab by: <emphasis role="strong">set(gdf(),'color_map',[0.75,0.5,0.25]'*ones(1,3))</emphasis>.</para>
2761</refsection>
2762
2763<refsection id="grid">
2764 <title>grid</title>
2765 <para>Grid lines for two- and three-dimensional plots </para>
2766 <para>There is no minor grid in Scilab. There is no equivalent function for Matlab <emphasis role="strong">grid</emphasis>
2767 function in Scilab but it has equivalents:</para>
2768 <para>grid on : may be replaced by <emphasis role="strong">set(gca(),'grid',[1 1])</emphasis></para>
2769 <para>grid off : may be replaced by <emphasis role="strong">set(gca(),'auto_clear',[-1 -1])</emphasis></para>
2770 <para>grid minor : can be emuled in Scilab by <emphasis role="strong">mtlb_hold</emphasis> but all grids are toggled</para>
2771 <para>grid : can be emuled in Scilab by <emphasis role="strong">mtlb_hold</emphasis></para>
2772 <para>grid(axes_handle,'on') : may be replaced by <emphasis role="strong">axes_handle.grid=[1 1]</emphasis></para>
2773 <para>grid(axes_handle,'off') : may be replaced by <emphasis role="strong">axes_handle.grid=[-1 -1]</emphasis></para>
2774 <para>grid(axes_handle,'minor') : can be emuled in Scilab by <emphasis role="strong">mtlb_hold</emphasis> but all grids are toggled</para>
2775 <para>grid(axes_handle) : can be emuled in Scilab by <emphasis role="strong">mtlb_hold(axes_handle)</emphasis></para>
2776</refsection>
2777
2778<refsection id="hankel">
2779 <title>hankel</title>
2780 <para>Hankel matrix </para>
2781 <para>The main difference between Scilab and Matlab function is that they do not use the same input values to build an Hankel matrix.
2782 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
2783 build and a covariance sequence vector for this matrix. (See syntax below)</para>
2784
2785
2786 <programlisting role="example"><![CDATA[
2787% Matlab version
2788H1 = hankel(C1)
2789H2 = hankel(C2,R2)
2790 ]]></programlisting>
2791
2792 <programlisting role="example"><![CDATA[
2793// Scilab version
2794N1 = size(C1,'*');
2795COV1 = [matrix(C1,1,-1),zeros(1,N1)];
2796H1 = hank(N1,N1,COV1);
2797M2 = size(C2,'*');
2798N2 = size(R2,'*');
2799COV2 = [matrix(C2,1,-1),matrix(R2(2:$),1,-1)];
2800H2 = hank(M2,N2,COV2);
2801 ]]></programlisting>
2802</refsection>
2803
2804<refsection id="help">
2805 <title>help</title>
2806 <para>Display help </para>
2807 <para>In Scilab you can not get help on a toolbox, only on a function. Scilab equivalent for Matlab <emphasis role="strong">help syntax</emphasis>
2808 is <emphasis role="strong">help('names')</emphasis>.</para>
2809</refsection>
2810
2811<refsection id="hold">
2812 <title>hold</title>
2813 <para>Hold current graph </para>
2814 <para>There is no equivalent function for Matlab <emphasis role="strong">hold</emphasis> function in Scilab but it has equivalents:</para>
2815 <para>hold on : may be replaced by <emphasis role="strong">set(gca(),'auto_clear','off')</emphasis></para>
2816 <para>hold off : may be replaced by <emphasis role="strong">set(gca(),'auto_clear','on')</emphasis></para>
2817 <para>hold : can be emuled in Scilab by <emphasis role="strong">mtlb_hold</emphasis></para>
2818</refsection>
2819
2820<refsection id="home">
2821 <title>home</title>
2822 <para>Move the cursor to the upper left corner of the Command Window</para>
2823 <para>Note that Matlab function has no effect in no window mode under Unix/Linux while Scilab one clears the terminal display
2824 as if you were using 'clear' command.</para>
2825</refsection>
2826
2827<refsection id="horzcat">
2828 <title>horzcat</title>
2829 <para>Horizontal concatenation </para>
2830 <para>Scilab equivalent for Matlab <emphasis role="strong">horzcat(A1,A2,...,An)</emphasis> is <emphasis role="strong">[A1,A2,...,An]</emphasis>
2831 if all <emphasis role="strong">Ai</emphasis> are not character strings, else, Scilab equivalent is
2832 <emphasis role="strong">A1+A2+...+An</emphasis>.</para>
2833</refsection>
2834
2835<refsection id="ifft">
2836 <title>ifft(A[,...])</title>
2837 <para>Inverse discrete Fourier transform </para>
2838 <para>Y = ifft(X) : If X is a vector then Scilab equivalent for Matlab <emphasis role="strong">ifft(X)</emphasis> is
2839 <emphasis role="strong">fft(X,1)</emphasis>. If <emphasis role="strong">X</emphasis> is a matrix then Scilab equivalent for Matlab
2840 <emphasis role="strong">ifft(X)</emphasis> is <emphasis role="strong">fft(X,1,2,1)</emphasis>.</para>
2841 <para>Y = ifft(X,n) / Y = ifft(X,n,dim) / Y = ifft(X,[],dim) : There is no Scilab equivalent for all these Matlab uses of
2842 <emphasis role="strong">ifft</emphasis>, in these cases, use <emphasis role="strong">mtlb_ifft</emphasis> instead.</para>
2843</refsection>
2844
2845<refsection id="if">
2846 <title>if</title>
2847 <para>Conditionally execute statements </para>
2848 <para>In Scilab condition can be ended by then but not in Matlab.</para>
2849</refsection>
2850
2851<refsection id="int16">
2852 <title>int16</title>
2853 <para>Convert to 16-bit signed integer </para>
2854 <para>For infinite and NaNs values, Scilab and Matlab <emphasis role="strong">int16</emphasis> return different values.</para>
2855
2856 <programlisting role="example"><![CDATA[
2857% Matlab version
2858A = int16(inf)
2859A = 32767
2860A = int16(-inf)
2861A = -32768
2862A = int16(nan)
2863A = 0
2864 ]]></programlisting>
2865
2866 <programlisting role="example"><![CDATA[
2867// Scilab version
2868A = int16(%inf)
2869A = -32768
2870A = int16(-%inf)
2871A = -32768
2872A = int16(%nan)
2873A = -32768
2874 ]]></programlisting>
2875</refsection>
2876
2877<refsection id="int32">
2878 <title>int32</title>
2879 <para>Convert to 32-bit signed integer </para>
2880 <para>For infinite and NaNs values, Scilab and Matlab <emphasis role="strong">int32</emphasis> return different values.</para>
2881
2882 <programlisting role="example"><![CDATA[
2883% Matlab version
2884A = int32(inf)
2885A = 2147483647
2886A = int32(-inf)
2887A = -2147483648
2888A = int32(nan)
2889A = 0
2890 ]]></programlisting>
2891
2892 <programlisting role="example"><![CDATA[
2893// Scilab version
2894A = int32(%inf)
2895A = -2147483648
2896A = int32(-%inf)
2897A = -2147483648
2898A = int32(%nan)
2899A = -2147483648
2900 ]]></programlisting>
2901</refsection>
2902
2903<refsection id="int8">
2904 <title>int8</title>
2905 <para>Convert to 8-bit signed integer </para>
2906 <para>For infinite values, Scilab and Matlab <emphasis role="strong">int8</emphasis> return different values.</para>
2907
2908 <programlisting role="example"><![CDATA[
2909// Scilab version
2910A = int8(inf)
2911A = 127
2912A = int8(-inf)
2913A = -128
2914 ]]></programlisting>
2915
2916 <programlisting role="example"><![CDATA[
2917// Scilab version
2918A = int8(%inf)
2919A = 0
2920A = int8(-%inf)
2921A = 0
2922 ]]></programlisting>
2923</refsection>
2924
2925<refsection id="interp1">
2926 <title>interp1</title>
2927 <para>One_dimension interpolation function </para>
2928 <para>Scilab <emphasis role="strong">interp1</emphasis> function doesn't work with the pchip interpolation method.</para>
2929</refsection>
2930
2931<refsection id="isa">
2932 <title>isa</title>
2933 <para>Detect an object of a given type </para>
2934 <para>There is no equivalent function for Matlab <emphasis role="strong">isa</emphasis>
2935 function in Scilab but it can be replaced by equivalent syntaxes as shown is examples.</para>
2936
2937 <table>
2938 <caption/>
2939 <tbody>
2940 <tr>
2941 <td>
2942 <para><emphasis role="strong">Equivalence table</emphasis></para>
2943 </td>
2944 </tr>
2945 <tr>
2946 <td><para> Matlab </para></td>
2947 <td><para> Scilab </para></td>
2948 </tr>
2949 <tr>
2950 <td><para> a = isa(x,'logical') </para></td>
2951 <td><para>a = type(x)==4; </para></td>
2952 </tr>
2953 <tr>
2954 <td><para> b = isa(x,'char') </para></td>
2955 <td><para>b = type(x)==10; </para></td>
2956 </tr>
2957 <tr>
2958 <td><para> c = isa(x,'numeric') </para></td>
2959 <td><para>c = or(type(x)==[1,5,8]); </para></td>
2960 </tr>
2961 <tr>
2962 <td><para> d = isa(x,'int8') </para></td>
2963 <td><para>d = typeof(x)=='int8'; </para></td>
2964 </tr>
2965 <tr>
2966 <td><para> e = isa(x,'uint8') </para></td>
2967 <td><para>e = typeof(x)=='uint8'; </para></td>
2968 </tr>
2969 <tr>
2970 <td><para> f = isa(x,'int16') </para></td>
2971 <td><para>f = typeof(x)=='int16'; </para></td>
2972 </tr>
2973 <tr>
2974 <td><para> g = isa(x,'uint16') </para></td>
2975 <td><para>g = typeof(x)=='uint16'; </para></td>
2976 </tr>
2977 <tr>
2978 <td><para> h = isa(x,'int32') </para></td>
2979 <td><para>h = typeof(x)=='int32'; </para></td>
2980 </tr>
2981 <tr>
2982 <td><para> k = isa(x,'uint32') </para></td>
2983 <td><para>k = typeof(x)=='uint32'; </para></td>
2984 </tr>
2985 <tr>
2986 <td><para> l = isa(x,'single') </para></td>
2987 <td><para>l = type(x)==1; </para></td>
2988 </tr>
2989 <tr>
2990 <td><para> m = isa(x,'double') </para></td>
2991 <td><para>m = type(x)==1; </para></td>
2992 </tr>
2993 <tr>
2994 <td><para> n = isa(x,'cell') </para></td>
2995 <td><para>n = typeof(x)=='ce'; </para></td>
2996 </tr>
2997 <tr>
2998 <td><para> o = isa(x,'struct') </para></td>
2999 <td><para>o = typeof(x)=='st'; </para></td>
3000 </tr>
3001 <tr>
3002 <td><para> p = isa(x,'function_handle') </para></td>
3003 <td><para>p = type(x)==13; </para></td>
3004 </tr>
3005 <tr>
3006 <td><para> q = isa(x,'sparse') </para></td>
3007 <td><para>q = type(x)==5; </para></td>
3008 </tr>
3009 <tr>
3010 <td><para> r = isa(x,'lti') </para></td>
3011 <td><para>r = typeof(x)=='state-space'; </para></td>
3012 </tr>
3013 </tbody>
3014 </table>
3015</refsection>
3016
3017<refsection id="isequal">
3018 <title>isequal</title>
3019 <para>Determine if arrays are numerically equal </para>
3020 <para>In Scilab, struct fields must be in the same order so that structs can be equal but not in Matlab.</para>
3021</refsection>
3022
3023<refsection id="isfield">
3024 <title>isfield</title>
3025 <para>Determine if input is a structure array field </para>
3026 <para>There is no Scilab equivalent function for Matlab <emphasis role="strong">tf=isfield(A,field)</emphasis>
3027 but there are equivalent instructions:</para>
3028 <para>If A is not a structure and/or field is not a character string: </para>
3029 <para>Scilab equivalent is <emphasis role="strong">%F</emphasis>.</para>
3030 <para>If A is a structure and field is a character string: </para>
3031 <para>Scilab equivalent is <emphasis role="strong">allfields=getfield(1,A);tf=or(allfields(3:\$)==field);</emphasis>.</para>
3032</refsection>
3033
3034<refsection id="isfinite">
3035 <title>isfinite</title>
3036 <para>True for finite elements </para>
3037 <para>There is no equivalent function for Matlab <emphasis role="strong">isfinite</emphasis> function in Scilab but it can be emuled by:
3038 <emphasis role="strong">abs(A)&lt;%Inf</emphasis></para>
3039</refsection>
3040
3041<refsection id="ishold">
3042 <title>ishold</title>
3043 <para>Return hold state </para>
3044 <para>There is no equivalent function for Matlab <emphasis role="strong">ishold</emphasis> function in Scilab but it can be emuled by:
3045 <emphasis role="strong">get(gca(),'auto_clear')=='off';</emphasis>.</para>
3046</refsection>
3047
3048<refsection id="isletter">
3049 <title>isletter</title>
3050 <para>True for letters of the alphabet </para>
3051 <para>There is no equivalent function to Matlab <emphasis role="strong">isletter</emphasis> function in Scilab.
3052 However it can be replaced as follows. Using <emphasis role="strong">mtlb_isletter</emphasis> will give a prettier code.</para>
3053
3054 <programlisting role="example"><![CDATA[
3055// Scilab version
3056tf = isletter(A)
3057 ]]></programlisting>
3058
3059<para>If A is a String matrix: </para>
3060
3061 <programlisting role="example"><![CDATA[
3062// Scilab version
3063tf = ((asciimat(A)>=65) & (asciimat(A)<=90)) | ((asciimat(A)>=97) & (asciimat(A)<=122))
3064 ]]></programlisting>
3065
3066<para>If A is not a String matrix: </para>
3067
3068 <programlisting role="example"><![CDATA[
3069// Scilab version
3070tf = zeros(A)
3071 ]]></programlisting>
3072</refsection>
3073
3074<refsection id="islogical">
3075 <title>islogical(A)</title>
3076 <para>Determine if item is a logical array </para>
3077 <para>There is no equivalent function for Matlab <emphasis role="strong">islogical</emphasis> function in Scilab but it can be emuled by:
3078 <emphasis role="strong">or(type(A)==[4,6])</emphasis>.</para>
3079</refsection>
3080
3081<refsection id="isnumeric">
3082 <title>isnumeric(A)</title>
3083 <para>Determine if input is a numeric array </para>
3084 <para>There is no equivalent function for Matlab <emphasis role="strong">isnumeric</emphasis> function in Scilab but it can be emuled by:
3085 <emphasis role="strong">or(type(A)==[1 5 8])</emphasis>.</para>
3086</refsection>
3087
3088<refsection id="isreal">
3089 <title>isreal</title>
3090 <para>Determine if all array elements are real numbers </para>
3091 <para>Scilab <emphasis role="strong">isreal</emphasis> function can take two values as input. The first one is the same as Matlab one and
3092 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
3093 and in Scilab, second input in Scilab function must be set to 0.</para>
3094
3095 <programlisting role="example"><![CDATA[
3096% Matlab version
3097tf = isreal(1+0i)
3098tf = 1
3099 ]]></programlisting>
3100
3101 <programlisting role="example"><![CDATA[
3102// Scilab version
3103tf = isreal(1+0*%i)
3104tf = %F
3105tf = isreal(1+0*%i,0)
3106tf = %T
3107 ]]></programlisting>
3108</refsection>
3109
3110<refsection id="isspace">
3111 <title>isspace</title>
3112 <para>Detect elements that are ASCII white spaces There is no equivalent function to Matlab <emphasis role="strong">isspace</emphasis>
3113 function in Scilab. However it can be replaced as shown below.</para>
3114
3115 <programlisting role="example"><![CDATA[
3116// Scilab version
3117tf = isspace(A)
3118 ]]></programlisting>
3119
3120<para>If A is a String matrix: </para>
3121
3122 <programlisting role="example"><![CDATA[
3123// Scilab version
3124tf = asciimat(A)==32
3125 ]]></programlisting>
3126
3127<para>If A is not a String matrix: </para>
3128
3129 <programlisting role="example"><![CDATA[
3130// Scilab version
3131tf = zeros(A)
3132 ]]></programlisting>
3133</refsection>
3134
3135<refsection id="issparse">
3136 <title>issparse(S)</title>
3137 <para>Test if matrix is sparse </para>
3138 <para>There is no equivalent function for Matlab <emphasis role="strong">issparse</emphasis> function in Scilab but it can be emuled by:
3139 <emphasis role="strong">or(type(S)==[5,6])</emphasis>.</para>
3140</refsection>
3141
3142<refsection id="isvector">
3143 <title>isvector</title>
3144 <para>Determine if input is a vector There is no Scilab equivalent function for Matlab <emphasis role="strong">tf=isvector(A)</emphasis>
3145 but there are equivalent instructions:</para>
3146 <para>If A is not a character string:: Scilab equivalent is <emphasis role="strong">tf = size(A,1)==1 | size(A,2)==1</emphasis>.</para>
3147 <para>If A is a character string:: Scilab equivalent is <emphasis role="strong">tf = size(asciimat(A),1)==1 | size(asciimat(A),2)==1</emphasis>.</para>
3148</refsection>
3149
3150<refsection id="length">
3151 <title>length(A)</title>
3152 <para>Length of vector </para>
3153 <para>If <emphasis role="strong">A</emphasis> is a vector, Scilab equivalent for <emphasis role="strong">length(A)</emphasis> is
3154 <emphasis role="strong">size(A,'*')</emphasis>.</para>
3155 <para>If <emphasis role="strong">A</emphasis> is a matrix, Scilab equivalent for <emphasis role="strong">length(A)</emphasis> is
3156 <emphasis role="strong">max(size(A))</emphasis>.</para>
3157 <para>If <emphasis role="strong">A</emphasis> contains character strings, String matrix has to be converted to a 'character' string matrix using
3158 <emphasis role="strong">mstr2sci</emphasis> (Using <emphasis role="strong">asciimat</emphasis> to convert will give the same result).</para>
3159 <para>Scilab <emphasis role="strong">length</emphasis> is different from Matlab <emphasis role="strong">length</emphasis>.</para>
3160</refsection>
3161
3162<refsection id="linspace">
3163 <title>linspace</title>
3164 <para>Linearly spaced vector </para>
3165 <para>When <emphasis role="strong">A</emphasis> and/or <emphasis role="strong">B</emphasis> is a String in Matlab,
3166 <emphasis role="strong">linspace(A,B[,n])</emphasis> returns a String matrix, in Scilab, it can be made with
3167 <emphasis role="strong">ascii(linspace(ascii(A),ascii(B),n))</emphasis>.</para>
3168</refsection>
3169
3170<refsection id="load">
3171 <title>load</title>
3172 <para>Load workspace variables from disk </para>
3173 <para>Scilab <emphasis role="strong">loadmatfile</emphasis> does not handle option <emphasis role="strong">-regexp</emphasis> yet.</para>
3174</refsection>
3175
3176<refsection id="log2">
3177 <title>log2</title>
3178 <para>Base 2 logarithm and dissect floating point number</para>
3179 <para>Scilab <emphasis role="strong">log2</emphasis> is equivalent to Matlab <emphasis role="strong">log2</emphasis>
3180 for logarithm computation, but for floating point number dissection, Scilab equivalent to Matlab <emphasis role="strong">log2</emphasis>
3181 is <emphasis role="strong">frexp</emphasis>.</para>
3182</refsection>
3183
3184<refsection id="logical">
3185 <title>logical(A)</title>
3186 <para>Convert numeric values to logical </para>
3187 <para>If <emphasis role="strong">A</emphasis> is not an empty matrix, Scilab equivalent for <emphasis role="strong">logical(A)</emphasis>
3188 is is not equal to <emphasis role="strong">0</emphasis> else Scilab equivalent is <emphasis role="strong">[]</emphasis>.</para>
3189</refsection>
3190
3191<refsection id="lookfor">
3192 <title>lookfor</title>
3193 <para>Search for specified keyword in all help entries </para>
3194 <para>No Scilab equivalent for Matlab <emphasis role="strong">-all</emphasis> option.</para>
3195</refsection>
3196
3197<refsection id="lower">
3198 <title>lower(str)</title>
3199 <para>Convert string to lower case </para>
3200 <para>If <emphasis role="strong">A</emphasis> is not a character string matrix, Scilab equivalent for
3201 <emphasis role="strong">B=lower(A)</emphasis> is <emphasis role="strong">B=A</emphasis>, else equivalent is
3202 <emphasis role="strong">B=convstr(A)</emphasis>.</para>
3203</refsection>
3204
3205<refsection id="lu">
3206 <title>lu</title>
3207 <para>LU matrix factorization </para>
3208 <para>There is no Scilab equivalent for Matlab <emphasis role="strong">lu</emphasis> when called with 1 or 4 outputs or with 2 inputs.</para>
3209</refsection>
3210
3211<refsection id="max">
3212 <title>max</title>
3213 <para>Maximum </para>
3214 <para>Matlab <emphasis role="strong">max</emphasis> function can work with complexes, what Scilab <emphasis role="strong">max</emphasis>
3215 can not, so a emulation function called <emphasis role="strong">mtlb_max</emphasis> has been written.
3216 Note that in Scilab, second input parameter can give the dimension to use to find the maximum values or another matrix (maximum of two matrices),
3217 in Matlab, dimension parameter is given in a third input parameter (in this case, second parameter must be
3218 <emphasis role="strong">[]</emphasis>).</para>
3219
3220
3221 <programlisting role="example"><![CDATA[
3222// Scilab version
3223C=max(A)
3224 ]]></programlisting>
3225
3226 <para>If <emphasis role="strong">A</emphasis> is a matrix, <emphasis role="strong">max(A)</emphasis> is equivalent to
3227 <emphasis role="strong">max(A,[],1)</emphasis> in Matlab whereas in Scilab <emphasis role="strong">max(A)</emphasis>
3228 gives the maximum value found in <emphasis role="strong">A</emphasis>. Matlab <emphasis role="strong">max</emphasis>
3229 treats the values along the first non-singleton dimension.</para>
3230
3231 <programlisting role="example"><![CDATA[
3232% Matlab version
3233A = [1,2,3;4,5,6]
3234C = max(A)
3235C = [4,5,6]
3236C = max(A,[],1)
3237C = [4,5,6]
3238B = [7,8,9;2,3,4]
3239C = max(A,B)
3240C = [7,8,9;4,5,6]
3241 ]]></programlisting>
3242
3243 <programlisting role="example"><![CDATA[
3244// Scilab version
3245A = [1,2,3;4,5,6]
3246C = max(A)
3247C = 6
3248C = max(A,'r')
3249C = [4,5,6]
3250B = [7,8,9;2,3,4]
3251C = max(A,B)
3252C = [7,8,9;4,5,6]
3253 ]]></programlisting>
3254</refsection>
3255
3256<refsection id="min">
3257 <title>min</title>
3258 <para>Minimum </para>
3259 <para>Matlab <emphasis role="strong">min</emphasis> function can work with complexes, what Scilab <emphasis role="strong">min</emphasis>
3260 can not, so a emulation function called <emphasis role="strong">mtlb_min</emphasis> has been written. Note that in Scilab,
3261 second input parameter can give the dimension to use to find the minimum values or another matrix (minimum of two matrices),
3262 in Matlab, dimension parameter is given in a third input parameter (in this case, second parameter must be
3263 <emphasis role="strong">[])</emphasis>.</para>
3264
3265 <programlisting role="example"><![CDATA[
3266// Scilab version
3267C = min(A)
3268 ]]></programlisting>
3269
3270 <para>If <emphasis role="strong">A</emphasis> is a matrix, <emphasis role="strong">min(A)</emphasis> is equivalent to
3271 <emphasis role="strong">min(A,[],1)</emphasis> in Matlab whereas in Scilab <emphasis role="strong">min(A)</emphasis>
3272 gives the minimum value found in <emphasis role="strong">A</emphasis>. Matlab <emphasis role="strong">min</emphasis>
3273 treats the values along the first non-singleton dimension.</para>
3274
3275 <programlisting role="example"><![CDATA[
3276% Matlab version
3277A = [1,2,3;4,5,6]
3278C = min(A)
3279C = [1,2,3]
3280C = min(A,[],1)
3281C = [1,2,3]
3282B = [7,8,9;2,3,4]
3283C = min(A,B)
3284C = [1,2,3;2,3,4]
3285 ]]></programlisting>
3286
3287 <programlisting role="example"><![CDATA[
3288// Scilab version
3289A = [1,2,3;4,5,6]
3290C = min(A)
3291C = 1
3292C = min(A,'r')
3293C = [1,2,3]
3294B = [7,8,9;2,3,4]
3295C = min(A,B)
3296C = [1,2,3;2,3,4]
3297 ]]></programlisting>
3298</refsection>
3299
3300<refsection id="mkdir">
3301 <title>mkdir</title>
3302 <para>Scilab <emphasis role="strong">mkdir</emphasis> returns 1 or 2 values but Matlab one can return up to three values
3303 (third output is a Matlab messageid).</para>
3304</refsection>
3305
3306<refsection id="mod">
3307 <title>mod</title>
3308 <para>Modulus after division </para>
3309 <para>Scilab <emphasis role="strong">pmodulo</emphasis> can work with Complex values what Matlab <emphasis role="strong">mod</emphasis> can not.</para>
3310</refsection>
3311
3312<refsection id="more">
3313 <title>more</title>
3314 <para>Display Command Window output one screenful at a time </para>
3315 <para>See examples. </para>
3316
3317 <programlisting role="example"><![CDATA[
3318// Scilab version
3319more off
3320more on
3321more(30)
3322 ]]></programlisting>
3323
3324 <programlisting role="example"><![CDATA[
3325// Scilab version
3326lines(0)
3327lines(60)
3328lines(30)
3329 ]]></programlisting>
3330</refsection>
3331
3332<refsection id="nargin">
3333 <title>nargin - nargin('fun')</title>
3334 <para>Number of function input arguments </para>
3335
3336 <table>
3337 <caption/>
3338 <tbody>
3339 <tr>
3340 <td>
3341 <para><emphasis role="strong">Equivalence table</emphasis></para>
3342 </td>
3343 </tr>
3344 <tr>
3345 <td><para> Matlab </para></td>
3346 <td><para> Scilab </para></td>
3347 </tr>
3348 <tr>
3349 <td><para> nargin </para></td>
3350 <td><para> argn(2) </para></td>
3351 </tr>
3352 <tr>
3353 <td><para> nargin('fun') </para></td>
3354 <td><para> size(getfield(1,macrovar(fun)),'*') </para></td>
3355 </tr>
3356 </tbody>
3357 </table>
3358</refsection>
3359
3360<refsection id="nargout">
3361 <title>nargout - nargout('fun')</title>
3362 <para>Number of function output arguments </para>
3363
3364 <table>
3365 <caption/>
3366 <tbody>
3367 <tr>
3368 <td>
3369 <para><emphasis role="strong">Equivalence table</emphasis></para>
3370 </td>
3371 </tr>
3372 <tr>
3373 <td><para> Matlab </para></td>
3374 <td><para> Scilab </para></td>
3375 </tr>
3376 <tr>
3377 <td><para> nargout </para></td>
3378 <td><para> argn(1) </para></td>
3379 </tr>
3380 <tr>
3381 <td><para> nargout('fun') </para></td>
3382 <td><para> size(getfield(2,macrovar(fun)),'*') </para></td>
3383 </tr>
3384 </tbody>
3385 </table>
3386</refsection>
3387
3388<refsection id="ndims">
3389 <title>ndims</title>
3390 <para>Number of array dimensions </para>
3391 <para>There is no Scilab equivalent function for <emphasis role="strong">ndims(A)</emphasis> but it can be emuled by:
3392 <emphasis role="strong">size(size(A),'*')</emphasis>.</para>
3393</refsection>
3394
3395<refsection id="num2str">
3396 <title>num2str</title>
3397 <para>Number to string conversion </para>
3398 <para>num2str(a,precision) : There is no Scilab equivalent for this Matlab expression.</para>
3399 <para>num2str(a,format) : Scilab equivalent for Matlab <emphasis role="strong">num2str(a,format)</emphasis>
3400 is <emphasis role="strong">msprintf(format,a)</emphasis>.</para>
3401</refsection>
3402
3403<refsection id="ones">
3404 <title>ones</title>
3405 <para>Create an array of all ones </para>
3406 <para>Note that in Matlab, <emphasis role="strong">A</emphasis> can contain complex values (in these cases, only real part of
3407 <emphasis role="strong">A</emphasis> is taken in account), what Scilab function do not tolerate.</para>
3408
3409
3410 <programlisting role="example"><![CDATA[
3411// Scilab version
3412B=ones(A)
3413 ]]></programlisting>
3414
3415 <para>Most differences stem from the use of <emphasis role="strong">ones</emphasis> in conjunction with
3416 <emphasis role="strong">size</emphasis>. In Scilab you do not need to use size: </para>
3417
3418 <programlisting role="example"><![CDATA[
3419% Matlab version
3420A = [1 2; 3 4];
3421B = ones(size(A))
3422B = [ 1. 1. ; 1. 1.]
3423 ]]></programlisting>
3424
3425 <programlisting role="example"><![CDATA[
3426// Scilab version
3427A = [1 2; 3 4];
3428B = ones(A)
3429B =[ 1 1; 1 1]
3430 ]]></programlisting>
3431
3432<para>As a result, if A is a scalar, then Matlab will return a <emphasis role="strong">A*A</emphasis> matrix of ones but in Scilab you get a
3433 <emphasis role="strong">1</emphasis> (just because a scalar is a <emphasis role="strong">1*1</emphasis> matrix), so use
3434 <emphasis role="strong">ones(A,A)</emphasis> to get the same matrix <emphasis role="strong">B</emphasis>. If <emphasis role="strong">A</emphasis>
3435 is a vector, Scilab and Matlab give the same <emphasis role="strong">B</emphasis>. Finally, if <emphasis role="strong">A</emphasis>
3436 is a matrix, in Scilab, <emphasis role="strong">B</emphasis> will be a matrix having the same size as <emphasis role="strong">A</emphasis>
3437 whereas in Matlab, you get an error message. </para>
3438
3439 <programlisting role="example"><![CDATA[
3440% Matlab version
3441B = ones(2)
3442B = [1,1;1,1]
3443B = ones(2,2)
3444B = [1,1;1,1]