Matlab as a Calculator

MATLAB stands for “Matrix Laboratory” and is an interactive, matrix-based system and fourth-generation programming language from Mathworks Inc., which 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 >>. The Matlab program provides the user with a convenient environment for performing many types of calculations. This introduction to Matlab will help users understand its importance and variety of applications in different scientific fields.

Matlab as a Calculator

Matlab has three primary windows.

1) Command windows
2) Graphics Windows
3) Edit Windows used to write M-Files

The common way to operate Matlab is to enter commands in the command window.

Matlab as a Calculator

>> 55 – 16
ans = 39
>> ans + 11
ans =50

Matlab assigns the results ans whenever you do not explicitly assign the calculations to a chosen variable.

>> 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
Matlab as Calculator

Learn R Programming Language

Leave a Comment

Discover more from Statistics for Data Analyst

Subscribe now to keep reading and get access to the full archive.

Continue reading