ENGR 101 Lecture Notes - Lecture 7: Truth Table, Logical Connective, Exclusive Or
Document Summary
Repetition leads to errors because there are more opportunities for typos. Repetition makes debugging difficult because mistakes are repeated. Experienced coders find code with repetition harder to read and understand. Collection of matlab code that is stored so you can run it later. Use global scope - can see everything ever created in matlab. Anything created in script files can be accessed in the future function files. Also matlab code but is used in a different way than script files. Use local scope - the code that runs inside of a function file cannot access variable that exist inside that workspace. Can only access variable that are inside that single file. Send it inputs, has access to only those inputs, then uses variables inside they work through inputs the function, then pass out outputs. Any variables created inside a function only exist until the function is done.