code for summing of 2 Variables: (write in m- file or commmand window)
this is the code used for summing of 2 variables and storing result in variable c the output is
![Screenshot (10)](https://matlabtutorialpoint.files.wordpress.com/2015/08/screenshot-10.png)
Subtraction code:
![Screenshot (11)](https://matlabtutorialpoint.files.wordpress.com/2015/08/screenshot-11.png)
multiplying and dividing:
![Screenshot (12)](https://matlabtutorialpoint.files.wordpress.com/2015/08/screenshot-12.png?w=660)
the arthematic operation are performed as shown in above examples
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)](https://matlabtutorialpoint.files.wordpress.com/2015/08/screenshot-10.png)
Subtraction code:
a=10
b=5
c=a-bthe output is
![Screenshot (11)](https://matlabtutorialpoint.files.wordpress.com/2015/08/screenshot-11.png)
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)](https://matlabtutorialpoint.files.wordpress.com/2015/08/screenshot-12.png?w=660)
the arthematic operation are performed as shown in above examples
No comments:
Post a Comment