



SCRAM(X) returns a scrambled vector and a vectorĬontaining the indices used to descramble it.

% containing the indices used to descramble it. % SCRAM(X) returns a scrambled vector and a vector % SCRAM Scramble the elements in a vector. The first contiguous group of lines that begin with "%" are treated as the help blurb for the function. After the function declaration, there are a series of lines that start with "%" (these are comments).By default all variables in m-files are local, so you may call them whatever you want. The input arguments are listed after the function name in the format (x1,x2,x3.etc) These variables are assigned values when the function is called. The name you use must be the same as the filename (minus the. Output arguments are listed in the format, (if you have only 1 you don't need the brackets). Following the function declaration there is a list of output arguments (in this case 1), a statement of the function name, and a list of input arguments.If you leave this out, matlab will treat the file as a "script" (see below). The first line begins with the word "function" This tells matlab that this is function.Let us examine the structure of this file: % FLIPUD(X) returns X with columns preserved and rows flipped %FLIPUD Flip matrix in the up/down direction.
