Which of the following assignment statements are valid? For those that are not valid, explain why. For those that are valid, show what value is placed into which variable. Assume the following variables have been defined: A = -7, B = -1, C = 6, D = -5.5
Note that the priority of operators is the same as in Microsoft Excel.
(a) X = A
A. The statement is valid, X contains the value ______ (Type an exact value shown in MATLAB workspace.)
B. The statement is not valid as variable name is invalid.
C. The statement is not valid as X is not defined.
D. The statement is not valid as it contains unexpected MATLAB operator.
E. The statement is not valid as A is not defined.
(b) B = Y
A. The statement is valid, B contains the value ______ (Type an exact value shown in MATLAB workspace.)
B. The statement is not valid as B is not defined.
C. The statement is not valid as Y is not defined.
D. The statement is not valid as it contains unexpected MATLAB operator.
E. The statement is not valid as variable name is invalid.
(c) Z = A + 65
A. The statement is valid, Z contains the value ______ (Type an exact value shown in MATLAB workspace.)
B. The statement is not valid as it contains unexpected MATLAB operator.
C. The statement is not valid as Z is not defined.
D. The statement is not valid as computation is not allowed on the right of =.
E. The statement is not valid as A is not defined.
(d) W = A * B + C
A. The statement is valid, W contains the value ______ (Type an exact value shown in MATLAB workspace.)
B. The statement is not valid as computation is not allowed on the right of =.