Lecture36 - Lecture 36 MATLAB Mandelbrot Engineering 101...

Info iconThis preview shows pages 1–11. Sign up to view the full content.

View Full Document Right Arrow Icon
Engineering 101 Engineering 101 Lecture 36 Lecture 36 MATLAB Mandelbrot MATLAB Mandelbrot Prof. Michael Falk University of Michigan, College of Engineering
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Announcements Announcements Project 8, Due Wednesday at 9pm Also on paper in your lab section Thurs/Fri. Samples of Exam 4 have now been posted Exam 4 will take place Fri, Dec 15 from 8-10am. Location to be announced. If you have a conflict with this time contact me by this Friday. The alternate exam time for those with exam conflicts only is Fri, Dec 15 from 10:30-12:30
Background image of page 2
More Announcements More Announcements Wednesday: Final MATLAB lecture Friday: Exam 4 Review Monday: Super Quiz Project 8 clarification: If a colony has 2 or more neighbors with the same, highest value of fitness that are of different types, the colony does not change .
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Default Arguments in Functions Default Arguments in Functions You may have noticed that some of the bulit-in MATLAB functions can accept and return different numbers of arguments. This is handled by using the values nargin and nargout .
Background image of page 4
nargin/nargout nargin/nargout nargin is equal to the number of input arguments passed into the function. nargout is equal to the number of output arguments requested from the function.
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Using nargin Using nargin Let’s say I want to have a procedure that has some default arguments if none is specified. function val = simulate(time, startval) val = zeros(time); if nargin<2 | isempty(startval) val(1) = 0; else val(1) = startval; end for t = 2:time val(t) = onestep(val(t-1)); end
Background image of page 6
Using nargin Using nargin Equivalently: function val = simulate(time, startval) val = zeros(time); if nargin<2 | isempty(startval), startval = 0; end val(1) = startval; for t = 2:time val(t) = onestep(val(t-1)); end
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Using nargout Using nargout function [m,v]=MeanVar(X) % MeanVar Computes the mean and variance n=size(X,1); m=mean(X); if nargout>1 temp=X-m(ones(n,1),:); v=sum(temp.*temp)/(n-1); end
Background image of page 8
Exercise 1 Exercise 1 Which function will take in up to 3 matrices and return the average of these matrices?
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Exercise 1 3.
Background image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/02/2008 for the course ENGR 101 taught by Professor Ringenberg during the Fall '07 term at University of Michigan.

Page1 / 35

Lecture36 - Lecture 36 MATLAB Mandelbrot Engineering 101...

This preview shows document pages 1 - 11. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online