
COMP130_Functions
Authored by W Mao
Computers
University
Used 9+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
8 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
MATLAB® program files can contain code for more than one function. In a function file, the first function in the file is called the main function,
which must have the same name as the file it is defined in.
True
False
2.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
What will happen if you define a sub-function with the same name as a built-in function?
There is an error
Your sub-function will be used in preference to the built-in function any time it is called within the same file.
Both the built-in function and your sub-function will be run when the function is called.
The built-in function will take precedence and your sub-function will be ignored.
3.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Given the following function header:
function f = func(alpha, beta)
Which of the following statements is the best way to invoke the function?
out = f(5, 6)
f(5, 6)
func(5, 6)
func([5, 6])
func(5)
4.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Using functions make the program run faster and more efficiently.
True
False
5.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
The following command can be used to determine the
number of inputs from function cos:
nargin(cos)
True
False
6.
FILL IN THE BLANK QUESTION
1 min • 5 pts
What’s the result to the following code?
myfunction = @(x,y) (x + y^2 + x*y);
x=2;
y=1;
z = myfunction(x, y)
7.
FILL IN THE BLANK QUESTION
1 min • 5 pts
What is the command used to change where
MATLAB® looks for function definitions?
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
Client/Server Network Model
Quiz
•
University
12 questions
Spreadsheet Starter
Quiz
•
7th Grade - University
10 questions
PLANNING AND PREPARING FOR MAINTAINANCE
Quiz
•
University
10 questions
Pertemuan1_jaringan komputer
Quiz
•
University
10 questions
Adobe Photoshop
Quiz
•
University
10 questions
Choose the level of Bloom’s Taxonomy
Quiz
•
University
10 questions
Introduction to Mobile Commerce
Quiz
•
University
10 questions
Pengantar Coding
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade