COMP130_Functions

Quiz
•
Computers
•
University
•
Hard
W Mao
Used 9+ times
FREE Resource
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?
8.
OPEN ENDED QUESTION
3 mins • Ungraded
Tips for your classmates when writing functions:
Evaluate responses using AI:
OFF
Similar Resources on Wayground
10 questions
Weekly Contest #8 - TechXNinjas

Quiz
•
University
11 questions
The keyboard and mouse

Quiz
•
4th Grade - Professio...
10 questions
Test Định kỳ

Quiz
•
University
10 questions
Kiến thức cơ bản về Python

Quiz
•
University
10 questions
TIU Quiz-14

Quiz
•
University
12 questions
Swift Fundamentals

Quiz
•
University
6 questions
Lab S5

Quiz
•
University
12 questions
JavaScript Quiz

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Would you rather...

Quiz
•
KG - University
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
10 questions
The Constitution, the Articles, and Federalism Crash Course US History

Interactive video
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
16 questions
Water Modeling Activity

Lesson
•
11th Grade - University
10 questions
ACT English prep

Quiz
•
9th Grade - University