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
>>format short

Muhammad Imdad Ullah

Currently working as Assistant Professor of Statistics in Ghazi University, Dera Ghazi Khan. Completed my Ph.D. in Statistics from the Department of Statistics, Bahauddin Zakariya University, Multan, Pakistan. l like Applied Statistics, Mathematics, and Statistical Computing. Statistical and Mathematical software used is SAS, STATA, GRETL, EVIEWS, R, SPSS, VBA in MS-Excel. Like to use type-setting LaTeX for composing Articles, thesis, etc.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

x Logo: Shield Security
This Site Is Protected By
Shield Security