1.

Global variables must be mentioned _____ an M-file.(a) at the top in(b) anywhere in(c) out of the(d) there is nothing called global variablesThe question was posed to me by my school principal while I was bunking the class.I would like to ask this question from Fine Tuning in division Interacting with MATLAB of MATLAB

Answer»

Right choice is (a) at the top in

The BEST explanation: MENTIONING the global variables at the top of an M-file allows the user to prevent any error RISING to usage of the same variable unconsciously. If we DECLARE it anywhere, it MAY so happen that we would need it at the beginning. Hence- it is plausible to declare it at the top of an M-file.



Discussion

No Comment Found

Related InterviewSolutions