Outline•Scope of variables•Bisection method•Bar cooling
Scope of variables•Variables–A variable defined in a function is only visible in this function. (a local variable)–Download “w02scopevariable01.m”. Run the code and understand it.•Global variables–A variable declared by “global” is a global variable–Download “w02scopevariable02.m”. Run the code and understand it.•Global variable is not recommended–Download “w02testGlobalVariable.m”. Run the code and understand it.
has intentionally blurred sections.
Sign up to view the full version.