hpeceeng

Saturday, January 18, 2014

Matlab simple addition program


FIRST MATLAB PROGRAMME FOR BEGINNERS 


This code vl help u 2 understand the how to use the Matlab codes.
I am giving an example codding for beginners.

Step 1;
Open the Matlab software





Step 2;
Now click File->New-> Script

Step 3;
Type the following code in Script




%% TYPE FOLLOWING CODE IN .M FILE
% Start
clc;
clear all;
a=5;% assume a as a variable of value is 5 
b=5;% assume b as a variable of value is 5
c=a+b;% assume c is sum of a+b

disp('Sum of two no. is ');
disp(c);
%End





  1. Then save this .m file. e.g: fristprog.m.
  2. After saving press F5 button or click Run icon (i.e. green right arrow icon).
  3. The result vl produced in command window .    
  4. It vl look like this



Step 4;



OUTPUT
Sum of two no. is
    10


To send free SMS Click here to join way2sms.com



No comments:

Post a Comment