FireStats error : FireStats: Unknown commit strategy SciLab vs. MATLAB
Search openAE
User Login

SciLab vs. MATLAB

User Rating: / 6
PoorBest 

Most of SciLab’s functions can be executed in the same manner as MATLAB; however, many commands have slightly different names.  For example, the % comment in MATLAB is substituted with the double forward slash //.  The following should be noted about basic functions in SciLab:

Similarities to MATLAB

1.  It is recommended to begin any program clearing the Command Console with the clc function and clearing the stored variables with the clear function.

2.  If, elseif, else, and end are identical.

3.  Use semicolon after functions to suppress displaying anything on the Console.

4.  Logical operators (*,&&,==,||,~) are the same.

5. disp function          

6. input, remember to add ‘s’ if inputting a string.

7. plot(x,y,z) See the help browser for additional plot settings though.

Close but no cigar- these functions change in SciLab

1.  fprintf varies depending on it’s usage.  When writing directly to the Console Window, use mprintf().  The same format in the interior applies.  Writing to a file instead of the Console requires the function mfprintf().

2.  sprintf changes to the function msprintf().  The same interior format applies.

3.  msgbox is messagebox()

4. When reading a file, while MATLAB provides a file handle, SciTools returns both a handle and an error indicator in a vector.  [fd,err]=mopen(file [, mode, swap ]).  Modes differ slightly too, search mode parameter in help to find desired mode.

5.  Cell Strings vary with an added trailing space and different structure.  Note the varied conversion functions in the help browser.

 

Console Variation SciLab 

SciLab Console (messagebox variation) 

While writing the script, pay close attention to the commands in the help browser to ensure that there aren’t any subtle errors due to old MATLAB habits.  A great way to adapt to the different syntax is to use the translator built into SciLab. 

Last Updated (Sunday, 28 March 2010 17:06)