37) Given the following script: W linspace(1,10); X- length(W); What is the valu
ID: 3730953 • Letter: 3
Question
37) Given the following script: W linspace(1,10); X- length(W); What is the value stored in X? a) 100 b) 11 c)99 10 e) The script will cause an error in MATLAB 38) Given the variable assignment: Z- 'MATLAB is the best!!' What is the value of Z when the command Z(11:15)- 'worst' is executed? a) 'MATLAB is the worst!!" b) MATLAB is worstest! e) MATLAB is the worst best" d) 'MATLAB is worst best!!' Questions 39-40 are based on the following script: pi 3.141592654/2 G sin(pi) clear H- sin(pi) 39) What is the value stored in G before the elear command is executed? a) 0 b) c)-1 d) NaN e) None of the above 40) What is the value stored in H? a)0 b)1 c)-1 d) NaN e) The last command in the script will cause an error in MATLAB 41)The list of parameters for any function that creates an array are always separated with a) commas b) semicolons c) enter keys d) blank spaces e) it depends on the array being createdExplanation / Answer
37) 100
linspace(a,b) function returns a row vector of 100 evenly space points between a and b
Now we are taking length of this vector and as saw above a vetor of 100 evenly spaced points will be created hence the length will be 100.
38) 'MATLAB is worstest'
Here we are replacing value from index 11 to 15 with worst. So Indext 11 starts at t and ends at b.
39) 1
The sin function returns the circular sine of the elements of X.
So it will have sin of pi.
40) NAN
This will return sin of pi value.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.