MATLAB Flashcards
What does Matlab stand for?
Matrix Laboratory
What symbol precedes all comments in Matlab?
%
Which of the following is not a pre-defined variable in Matlab
Gravity
This Matlab command clears all data and variables stored in memory
Clear
Characters in Matlab are represented in their value in memory
ASCII
What is not an aspect of a for/while loop
Runner
To better manage memory and prevent unnecessary memory allocations, Matlab uses:
Delayed copy
To print a newline in a fprintf statement, you must use the following escape character l
\n
In Matlab, this keyword immediately moves to the next iteration of the loop
continue
Which of the following will correctly define x,y, and z as symbols?
syms x y z/ syms xyz
Which of the these is the way to access the first element in a vector named v (assuming there is at least one element in the vector)?
v(1)
Which of the following is used to see of two elements are equal in MATLAB?
=
If vector = [1 2 3 4; 11 24 92 100; 345 65 90 1]. What will the value of a be equal to if this code is entered into Matlab»_space; [ a b ] = size (vector)?
1 2 3 4
What is the value of ans that is printed when the following code is run: isnumeric(32)
1
If I want to save a formatted string to memory, but don’t want to print it out, which command should I use?
sprintf
When used in the fprintf, the %g is used as
Default number display
When used in the fprintf command, the \n is used to
Add a line space (enter key)
To display ‘Question 2’ in the command window, the correct command is
disp(‘Question 2’)
The clc command is used to
Clear the command window
The num2str command
Converts a number to string
“The output of the last line is
aa=2
as=num2str(a2.
cat=[‘cat’ as]
cat1
To join one or more strings into a single string is known as
Concatenation
The output of cat=[‘cat’ ‘dog’] is
catdog
Which functions help you to save and load variables?
Expl. There is a pre-defined function in MATLAB to store the variable values from your workspace permanently called “save filename”
> > save Lays a b
load (‘myfile.mat’)