AIM:
Practicing SCI LAB environment with simple exercises to familiarize with Command Window, History, Workspace, Current Directory, Figure Window, Edit Window, Shortcuts, and Help files.
SOURCE CODE:
Working on general commands in the Scilab environment:
// Basic Commands
help // Detailed help menu for Scilab commands
who // Lists all the variables from the variable browser window
whos // Lists all the variables with byte size, variable type, etc.
clc // Clears the command window
clear // Removes the variable from memory
quit // Closes the session
pwd // Shows the present working directory
ls // Lists the files in the current directory
cd // Changes the directory
mkdir // Creates a new directory
Special Variables / Pre-Defined Variables:
%pi // Value of Pi (≈ 3.14)
ans // Stores the most recent result
%e // Euler’s number (≈ 2.718)
%eps // Machine precision (epsilon)
%inf // Infinity
Basic Scalar & Vector Operations:
// Scalar Element
y = [1 4 6] // Declares a row vector
yT = [1; 4; 6] // Declares a column vector
// Matrix (Vector Elements)
Y = [1 4 6; 2 7 3; 4 1 1] // Creates a 3x3 matrix
// Determine the size / order of the vector or matrix
size(y)
// Changing specific elements in a vector or matrix
Y(2,3) = 10 // Changes the element at 2nd row, 3rd column to 10
// Element-by-element operations using dot operator
linspace(0, 1, 5) // Generates a vector: 0 0.25 0.5 0.75 1
RESULT:
The study of basic Scilab commands was successfully practiced and executed.