ABCs_functions - a % function out = myFunc answers(6) =...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
function answers = ABCs_functions f % This time, answer true for yes/true or false for no/false. % % Example. Prof. Marsicano teaches CS 1371. example = true; e % Functions and scripts are both stored in M-files. answers(1) = true; a % Functions and scripts are essentially one and the same. answers(2) = false; a % Functions have thier own scope; that is, variables that are defined % inside a function do not affect the workspace in which the function is % run. answers(3) = true; a % Functions that I write will work even if they are not in my current % folder. answers(4) = false; a % Are the following function headers valid for the function myFunc? % function myFunc = [in1, in2] answers(5) = false;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: a % function out = myFunc answers(6) = true; a % function [out two three] = myFunc(in) answers(7) = true; a % function [out] = myFunc(out) answers(8) = true; a % function (out two) = myFunc[in] answers(9) = false; a % function [out out2] = myFunc(in in2); answers(10) = false; a % If i have a valid function "myFunc" with the header: % function [out1 out2] = myFunc(in) % and I call [a b] = myFunc(13) from the command line. .. % % Is "a" defined in my workspace (have I assigned it a value in the % workspace)? answers(11) = true; a % Is "out2" defined in my workspace? answers(12) = false; a % Is "in" defined in my workspace? answers(13) = false;...
View Full Document

Ask a homework question - tutors are online