02 Matlab and Roots I

Figure1theplotwillbefig1 widthlinspace01050

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

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: (f, 4) % find root in vicinity of 4 x = 2.8990 >> x = fzero(f, ‐4) % find root in vicinity of ‐4 x = ‐6.8990 Function definition command >> f = @(x) a*x^2 + b*x + c; Function definition. Function arguments (inputs). Does not have to be x. Multiple inputs are possible. Name by which the function will be known. This does not have to be f. The argument names serve only to identify arguments within the definition. They have no other significance (variables are not created and any existing variables having the same names are not affected). When variables (e.g. a, b, c) are used in a function definition the function is based on the current values of these variable. If the variables are subsequently changed the function does NOT chang...
View Full Document

This note was uploaded on 03/30/2013 for the course ECOR 2606 taught by Professor Goheen during the Spring '10 term at Carleton CA.

Ask a homework question - tutors are online