1.

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 fileI got this question in an international level competition.My enquiry is from M-Files topic in portion Interacting with MATLAB of MATLAB

Answer»

Right answer is (b) She has placed a semicolon at the end of the line which computes the desired values

To explain: 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.



Discussion

No Comment Found

Related InterviewSolutions