User:Eml4500.f08.Lulz.js/HW1

Part 11: Submatrices and colon notation
This section of the primer discusses more advanced matrix manipulation techniques.

   
 * The first example shows the use of non-integral increments and boundaries in matrix declaration:
 * The next example employs a table of  values to demonstrate matrix generation from a set of vectors:
 * The following set of examples display the various uses of the colon operator in MATLAB:
 * The final set of examples for this section explores reordering of vectors using both colon notation and the  and   commands.

Part 12: M-files: script files, function files
This section of the primer discusses MATLAB's M-file system for executing command sequences. MATLAB handles two types of M-files: scripts and functions.

 First, the MATLAB code saved as :
 * The first example shows the use of a simple script for creating a matrix:

And then the execution of the script to create the matrix:

 First, the MATLAB code saved as the function :
 * The next example employs a function to generate a n-by-m matrix of random numbers from 0 to 9:

And the calling of the function to generate a 4-by-5 matrix:

 First, the MATLAB code saved as : Next, two function calls are made to. The first displays the aforementioned multiple outputs: And the second displays a single output (no square bracket required): Lastly, the  command is used to display the header for  : 
 * The next function highlights the capability to have multiple outputs:
 * The last function examples highlight the use of the  command to pass functions to other functions:

First, the MATLAB code for the function, which finds the zero of a passed function via bisection method:

And the function call to find the zero of the sin function near x = 2: 
 * Finally, the primer notes the usefulness of the  command to identify the nature of functions:

Part 13: Text strings, error messages, input
This section of the primer discusses the various methods of handling text in MATLAB.

  Note that when the  command is used, the resulting output is displayed in red. 
 * The first example shows the necessity of single quotes for defining a simple text string:
 * The next example features use of the  and   commands:
 * The final example features text-based input: