Sunday, October 13, 2013

MATLAB: A Syntactical Look

After opening MATLAB you should see the command window . You can recognize this by seeing the command prompt  >>

Note: In MATLAB comments are written after % symbol
Lets start with some simple commands

Command              
>>clc    % This is used to clear the the command screen
>>clear  % Is used to clear the variables


These commands are very basic

Now let us look at a few more commands. If we want to create a variable its very simple

>>a=1 % This creates a variable a with value 5

Few more variables
>> b=5  % b=5
>> c=3.14 % c=3.14
>>name='Vijay'    % creates a string variable  of name=Vijay

The best part is we need not define if the variable is a integer float or string MATLAB takes care of all this stuff . That is why it is a weakly typed language

MATLAB Basic Commands

So if we need to create a variable just use a variable_name = value ....
thats it. The only thing to note here is the variable_name should not be a inbuilt function name or predefined name

In the next post we will write a few basic MATLAB scripts  ..


MATLAB Practical Aspects


Here are a few technical things related to MATLAB
Matlab  is developed by MathWorks appeared in 1970s and is Written in C, C+ , JAVA . It can run Cross Platform. Matlab codes are saved as .m files.   MATLAB is a weakly typed language and has following Paradigms multi-paradigm: imperative, procedural, object-oriented, array

LOGO:

Matlab Logo.png





Below is a screenshot of MATLAB 2013a
MATLAB R2013a Win8 screenshot.png


Source : Wikiedia




In the next post we will start with few basic syntax of MATLAB