Looks like no one added any tags here yet for you.
From what distribution does rand() function return value?
Uniform
Based on the code below, c is the_ of a
a = rand(I, II);
b = sort (a);
c = b(1, ceil (end/2);
Median
What does the Profiler track?
Execution time
Which code block contains the correct syntax for a while loop?
a = 0 ; *
while a < 5
a = a + 1 ;
end
You have written a function myfun and want to measure how long it takes to run, which code segment will returnt the time in conds it takes myfun to run?
b. tic; * myfun (); toc;
What is %% used for?
code sections
What is the character NOT used for
Cell array access
Which function could you use for multiple linear regression
Regress
For which of these arrays do mean, median and mode return the same value
[01 1 1 2]
You are in the middle of a long MATLAB sessions where you have performed many analyses and made many plot. You run the following commands, yet a figure window doesn't pop-up on the top of your screen which you plot, what might be the issue
x = [-1: 0.1: 1]; y = x.^2; plot (x,y)
you plot is in a figure window that was already open, hidden behind other windows on your screen
How do you access the value for the field name in structure S
S name
What built-in definition does i have
basic imaginary unit
Which statement is equivalent to this loop
a = [123; 456];
b=zeros (size(a));
for i row = 1: size(a, 1)
for i_col = 1: size(a,2)
b (i_row, i_col) = a(i_row, i_col^2);
end
end
b = a.^2;
You have plotted values of cosine from -10 to 10 and want to change the x-axis tick marks to every pi, from -3pi to 3pi, which statement will do that
xticks (-3pi:pi:3pi)*
What is the value of c a = ones (1,3); b = 1:3; c = conv (a,b)
[1 3 6 5 3]
Which function cannot be used to random sample data
resample
Which choice is correct syntax for a switch statement
x = 7
switch x
case 2
disp ("two");
otherwise
disp ("not two");
end
picture
c=inf
What is true of a handle class object
all copies of handle objects refer to the same underlying object
Which choice has a different final result in f10 than the other three
f10 = 1 ;
i = 1;
while i <= 10
i = i + 1
f10 = i * f10;
end
Which choice will not give you a 5x5 identity matrix
indentity (5)
my_func is a function as follows. What is the value of a at the end of the code beneath?
1
Which choice add b to each row of a?
a=a + repmat(b,4,1);
Which statement returns the roots for the polynomial x² + 2x - 4 = 0?
roots([1 2 -4]
What is the set of possible values that a may contain?
a = randi([1, 10]);
a(3) = 11;
a(a > 2) = 12;
1, 2, 12
Which statement is true about the sparse matrix?
sparse matrices always use less memory than their associated full matrices
Which statement using logical indices will result in an error?
a = 1:10;
b = a(a > 6 && a < a')
Which is not a function that adds text to a plot?
label
What kind of files are stored with .mat extension?
Stored variable files
Which statement returns 1 (true)?
a = 'stand';
b = "stand";
a. a == b
a == b
What does E contain?
C = {'dog', 'cat', 'mouse'};
D = {'cow', 'piranha', 'mouse'};
E = setdiff(C, D);
E = {'cat'} {'dog'}
Where in UI can you see what variables have been created, their values, and their class?
workspace
If you run this piece of code, you will get an error, why?
a = [0 1 2 3; 4 5 6 7];
a = a^2
you are attempting to multiply a non-square matrix by itself causing a dimension mismatch
Which command will create a 10-element vector v with variables from 1 to 10?
v = 1:10
For a 5x5 array, the two subscript indices (4,2) indexes the same location as linear index?
9
What is the difference between global variable and persistent variables?
global variables are accessible outside the function scope.
How is the random seed for MATLAB's random number generator first initialized in a MATLAB session?
seed is set to a static default value on start up
At what will MATLAB look first for a called function?
functions within the current directory
Picture
5 2
7 4
Which statement will return all the odd numbers from 1 to 9?
1:2:9
What is the size of 'b'?
a = [1 2 3];
b = repmat(a, 3, 2);
2x9
What statement reverses vector a?
a = [1 2 3 4];
a(:,end:-1)
Which command will create a column vector with the same values 7, 8, and 9
c = [7 ;8; 9]
What do you call in the command window to see all the variables in the workspace and their classes.
whos
You wrote a new function named snap in an m-file and when you call it, you're not getting the output you expect. You previously wrote a different function named snap, which you think might also be on the search path. Which command can you use to see if the old snap function is being called?
to include a variable greater that 2GB
Which choice cannot add a directory to the search path?
the savepath function
Which is not a function to plot three-dimensional data?
grid
What is a key difference between && and &?
&& & employs short-circuiting behavior and & does not.
What is the result of this code? s = 'abcd'; s(3) = 'x'
a 1x3 string array
In which case would you use varargin in a function you write?
You want to include optional input arguments.
What does e contain?
c = [9 8 0];
d = [0 0 1];
e = union(c,d);
e = [0 1 8 9]
What does this function print?
a = 1;
for i_loop = 1:6
disp(a);
end
: nothing will print
Which statement returns the character array 'alone'?
b = ['stand' 'alone'];
b(6:end)
What does b contain?
a = [9 8 8 19 6 1 19 6 6 19];
b = unique(a)
b = [1 6 8 9 19]
Which code shows the use of ellipsis in MATLAB?
A = [123; ... 567]
What is the advantage of MATLAB over other computing software with matrix dimensions?
Real time user-defined memory allocation