Introduction to Matlab: Matlab use as Calculator
MATLAB stands for “Matrix Laboratory” and is an interactive, matrix-based system and fourth-generation programming language from the Mathworks Inc., is mathematics software. Matlab helps to perform statistical analysis and gives the user complete freedom to implement specific algorithms and perform complex custom-tailored operations. Matlab has a command-driven approach. Commands with appropriate arguments are written after the matlab command prompt >>. Matlab program provides the user with a convenient environment for performing many types of calculations. Here introduction to Matlab will help users to understand the importance and variety of application in different scientific fields of life.
Matlab have three primary windows.
1) Command windows
2) Graphics Windows
3) Edit Windows used to write M-Files
Common way to operate Matlab is to enter commands in command window.
Use of Matlab as Calculator
>> 55 – 16
ans = 39
>> ans + 11
ans =50
Matlab assigns the results to ans whenever you do not explicitly assign the calculations to a variable of your own choosing.
>> a = 4 %assigns a scalar quantity to a
>>a %Prints the scalar quantity in command windows
>>a = 4; % suppressed echo printing
>>a =4; A=6; x=1; % multiple variable definition
Note: Matlab treats names as Case-Sensitive.
>>format long
>>pi
>>format short
>>pi