A student is repeatedly calling a function file but gets no output. She has checked the file repeatedly so finally she asked her teacher

A student is repeatedly calling a function file but gets no output. She has checked the file repeatedly so finally she asked her teacher about it. The teacher checked everything and finds the error and gives her a scolding. What is a silly mistake?
A. She was calling the wrong function
B. She has placed a semicolon at the end of the line which computes the desired values
C. She has called a .m file
D. She was calling a script file
 
Answer: b
Explanation: If we write a function file, we should not put a semicolon at the line which computes a value. This will lead to the passing of cursor to the next line after the function is implemented without showing any output. So it was good that the teacher scolded her.
 

Tìm kiếm

Back
Top