2) What value does MATLAB compute from the command ble? a) 1 b) 2 d) 4 e) 8 33)
ID: 3730951 • Letter: 2
Question
2) What value does MATLAB compute from the command ble? a) 1 b) 2 d) 4 e) 8 33) What value does MATLAB compute from the command die? a) 0 b) 2 c) 6 d) eps e) NaN Questions 34-35 are based on the following MATLAB script: P-5 clear 34) When the script is run, which variables does the command window display? a) p e) The script will not run because variables were not specified in the clear command c) r d) both a and b 35) If the last command was replaced with clears ,then what would MATLAB display when the who command is issued? a) variable s b) variables p and r c) variables p, r, and s d) no variable are displayed e) a description of what Horton has been hearing 36) If A has not yet been defined in a MATLAB script, which set of commands performs the same result as if the command, A-eye(3) is executed? a) A-ones(3,3); A(2:2,3:3)-[] c) VI11 1]; A-diag(V); b) A(1,1)-1; A(2,2)=1; A(3,3)-1 d) both b and c e) all of the aboveExplanation / Answer
1) What value does MATLAB compute from the command bc ?
Ans) (Backslash or matrix left division) For Example,
if b=2 and c=4 then
bc= 2
2) What value does MATLAB compute from the command dc ?
Ans) simillarly, if d=6 and c=4 then
dc= 0.66667
3) based on the following MATLAB scrip
p=5; r=7; s=6 clear
(a) When the script is run, which variables does the command window display?
Ans) s=6, because there is no semicolon. If every statement end with ;(semicolon) the statement not printed, if there is no semicolon then print that statement
4) if the last command was replaced with clear s, then what would MATLAB
display when the who command is issued?
Ans) C
display s=6 and variables in the current scope: p, r, because the the current history of variables are displayed
5) If A has not yet been defined in a MATLAB script, which set of commands performs the same result as if the command, A=eye(3) is executed?
Ans) V=[1 1 1]; A=diag(V)
A=eye(3) is printing diagonol matrix i.e.,
A=
Diagonal Matrix
1 0 0
0 1 0
0 0 1
V=[1 1 1]; A=diag(V)
V contains diagonal values [1 1 1] then display
A=
Diagonal Matrix
1 0 0
0 1 0
0 0 1
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.