Saturday, 29 August 2015

OPERATION ON VARIABLES IN MATLAB

code for summing of 2 Variables: (write in m- file or commmand window)
a = 10                             (initilizing "a ") 
b =20                               (initilizing "b")
          c = a+b                             ('+' operator is used for summing two  variables')                                        
this is the code used for summing of 2 variables and storing result in variable c the output  is

  Screenshot (10)

Subtraction code:
a=10 
b=5 
c=a-b
the output is

  Screenshot (11)

 multiplying and dividing:
a=10 
b=5  
c=a*b                    ( '*' operator is used for subtraction) 
d=a/b                     (' / ' operator is used for division)
The output is
  Screenshot (12)

the arthematic operation are performed as shown in above examples

No comments:

Post a Comment