function newtdrive%we pass our values for qnewt here
%
0ewtdrive.m
%
%Using a combination of polyval and a program created to take the
0erivative, mypolyder, to find the Newton's basins and wasteland
4
Solving One Complex Equation via Newtons Method
Matlab Concepts: String manipulation via strcat and strrep, working with polynomials via
polyval and roots, using find, pointwise operations, ecient c
1
Iterations, Matrices, and Fractals
Matlab Concepts: for loops, vectors, matrices, programs, basic plotting
Isolated computations can often be done using pencil and paper or a calculator. A computer
Representing Numbers in Matlab
Real numbers (R) are represented by a oating-point number system on digital computers. The idea is similar to scientic notation, in which a very small or very large numb
3
Finding the Roots of a Real Equation
Matlab Concepts: Coding mathematical algorithms
Matlab provides many means with which to solve equations, including its polynomial root
nder, roots, and its symb
5
Optimization
Matlab Tools: Optimization solvers fminunc and fmincon, nested functions, inline functions,
3D plots using surf, bar graphs
Optimization is a branch of mathematics in which one determin
Table of Contents
.
Part 1: Bisection graph .
Part 2: Bisection vs. Newton graph .
Bisection Method .
Newton's Method .
Evaluation of Function .
Evaluation of Function's Derivative .
1
1
2
3
4
4
4
fun
2
Sequences and Series
Matlab Concepts: for/while loops, functions, subfunctions, logarithmic plots, 3D plots
This week we will study how Matlab can be used as a tool to numerically study the converge
6
Gaussian Elimination
Matlab Concepts: Coding algorithms, constructing linear systems
Matlab has a vast array of tools for linear algebra tasks. We have already seen how Matlab
eciently computes mult
8
Boolean Gene Networks
Matlab Concepts: Boolean logic, binary expansions, bioinformatics toolbox, cell/structure arrays
We have now seen two examples of discrete dynamical systems, or systems for whi
%
% Kathryn Hedrick, EN.500.200, F2014, Lab Example
%
% labex.m
% Generate the pattern containing the product of the first n numbers
%
% 2. Plot each number in the pattern
figure
p = 1;
plot(1,p,'.r',
11
Recursive Functions
Matlab Concepts: Recursive functions
We are now experts in performing iterative computations using for and while loops. This
week well explore a second method: the use of a recu
10
Deterministic Chemical Kinetics
Matlab Concepts: symbolic toolbox, analytical and numerical solutions to ODEs, global vs. local
variables
The stochastic view is a bare-handed means of following the
Project 6: Gaussian Elimination
10/21/2014
1.
The aim of this project was to solve for the coefficients of a trigonometric equation
using curve fitting and Gaussian elimination to solve a linear syste
Project 12: Evolutionary Game Theory
12/19/14
1.
The aim of this project was to run experiments on Evolutionary Games and Spatial
Chaos on an M-by-N board. A prisoners dilemma situation was conducted
Example Coding Project for Lab, 8-29-14
1. Create a program named labex.m by typing edit labex.m.
2. Generate the pattern
n
pn =
i
i=1
using a for loop. Plot the points, cfw_(n, pn )6 as red dots. (Ty
function mygilldrive
%Clara Molineros
%
%mygilldrive.m
%
%The goal of this project was to simulate stochastic dynamical systems,
%using cell arrays, cumsum, and interp1.
T=100;0uration (in sec) of the
Table of Contents
.
State Transition Graph .
Mutant State Transition Graph .
Decimal to Binary Subfunction .
Binary to Decimal Subfunction .
Transition Matrix Construction Subfunction .
1
1
2
3
3
4
fu
function hopfield
figure
paintings=cfw_'scream.jpg','gothic.jpg','frida.jpg','pearl.jpg';
imgscfw_4=[];
ibwcfw_4=[];ets up slots for values
for i=1:4
imgscfw_i=imread(paintingscfw_i);%cfw_ are for acc
Quiz 2
All answers should be written in Matlab syntax, as you would write the commands in the
Matlab command window or editor.
1. Suppose the vector s is constructed through the following code:
s = on
%
%m HW 1
%
%
%
% This code utilizes linear transformations and probablility and if-else
% clauses to manipulate the shape of the old-school fractalfern and
% form it into a different fractal fern.
%
function sudokudrive
%
udokudrive.m
%
%The goal of this project was to create a Sudoku solver using
matlab's%recursive fuctions.
load puzzle.mat
disp('Unsolved puzzle.mat')how unsovled
showPuzzle(M)
[
function reacdrive
%
%reacdrive.m
%
% This assignment used the symbolic toolbox, analytical and numerical
% solutions to ODE's, and global variables to model deterministic
chemical% kinetics.
close al
function optidrive
%
%optidrive.m
%
%Used nested functions, inline functions,linspace, and fmincon and fminunc
%to solve optimization problems, one constrained and one unconstrained.
Pt I: Optimal Lif
"'l' - u-.qrir _
"-F- .-
II-u- .-I._r. .1. _
_.
1.! all-h
I
i
r
I!
1"
III
- r.-
l.
" 11-. _
I ' 1. 4.?
l
Ii
I
'.'
d 1-.-'-|- .-
' n. . r 'i- i. p a-
. Uhlr w._H_-.1F_-Hur #_.1d_H-_dr
Wu M'H'Wiw :- -
Quiz 1
4/14
All answers should be written in Matlab syntax, as you would write the commands in the
Matlab command window.
1. Write a for loop to compute the sum of the rst 50 odd numbers. In other wor