to change a variableto change a variable the


To change a variable:

To change a variable, the other assignment statement can be used that assigns the value of a different expression to it. Consider, for illustration, the following sequence of statements:

>> mynum = 3

mynum =

3

>> mynum = 4 + 2

mynum =

6

>> mynum = mynum + 1

mynum =

7

In the initial assignment statement, the 3 is assigned to the variable mynum. In later the assignment statement, mynum is changed to have the value of the expression 4 + 2, or 6. At the third assignment statement, mynum is changed all over again, to the result of the expression mynum +1. As at that time mynum had the value 6, the value of the expression be 6+1, or 7.

Request for Solution File

Ask an Expert for Answer!!
Applications of MATLAB: to change a variableto change a variable the
Reference No:- TGS0174693

Expected delivery within 24 Hours