Sunday, July 25, 2010

MATLAB

"MATLAB" as the name reveals , is a programming language for the enginners.
In MATLAB we can do anything which can be done in any other programing language in better and simple way.
NOW
MATLAB COMMAND WINDOW
    SOME BASIC THINGS "HOW TO GET STARTED WITH MATLAB"
The image is of matlab starting screen with a command window in middle.









 Second step toward matlab..
Any program written in command window cant be
saved and if error occurs we have to write the whole program again. So for programing we open a new M-file. The image here illustrate how to open a new M-file. click on file--->Blank M-file.....

write the program on M-file and save it...when progam runs result is displayed in command window..

Let us start with a simple program "CONVERTING DECIMAL TO BINARY IN MATLAB"
1. clc;
2.a=input('enter the decimal number');
3.b=dec2bin(a,8);
4.b
%  percent sign is used to write comments within program
% matlab function dec2bin(a,8) converts decimal number in 'a' to binary no of 8-bits

result in command window

1 comment: