In MATLAB we can do anything which can be done in any other programing language in better and simple way."MATLAB" as the name reveals , is a programming language for the enginners.
NOW
MATLAB COMMAND WINDOW |
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 |
for any further assistance contact through mail
ReplyDelete