Shu Zhu; UID:112538149
clear all
%project2
%problem1
syms x t f(x)
%problem2
p2a=diff(x^3,2)
p2b=diff(sin(x)^2*tan(x)^2*(4*x+3)
p2c=diff(5-2*t^2)^(1/3)
p2d=subs(diff(1/(4*x-2),x,3)
%problem3
%a
syms f
Functions
Table of Contents
What is a Function? .
Symbolic Expressions .
Plugging into Symbolic Functions .
Derivatives of Symbolic Functions .
Derivatives and Plugging .
Function Handles .
Function M
What is a Function M-File?
Table of Contents
A Simple Function M-File . 1
The General Idea . 2
A (More) Complicated Function M-File . 3
Suppose you wished to write your own function which you could ac
Publishing
Table of Contents
What is publishing? .
Example .
Basic Structure .
Blank Lines .
1
1
3
3
What is publishing?
MATLAB's publish feature is a powerful tool that allows you to create nicely fo
Basic Programming
Table of Contents
Introduction .
Displaying Stuff - disp .
Condition - if .
Loop - for .
More Examples of Loop - for .
Loop - while .
The General Idea when Comparing Successive Value
Obtaining and Running Matlab
Table of Contents
Three Ways . 1
Version . 1
First you'll have to get Matlab.
Three Ways
There are three primary ways in which you can obtain Matlab, they are as follows:
Basic Commands
Table of Contents
Help! . 1
Arithmetic and More . 2
Precision and Other Display Stuff . 3
Here are some basic commands to get you started.
Help!
One of the most useful and useless comma
What Can We Do with
a Function M-File?
Table of Contents
Multiple Parameters .
Passing Functions to Functions .
A More Complicated Example .
Documenting Your M-File .
1
1
2
3
Multiple Parameters
Funct
Symbolic Solutions
Table of Contents
The Symbolic Approach .
Solving One Equation Symbolically .
Which Variable to Solve For? .
Solving When Not Equal to Zero .
Solving a System of Equations Symbolica
Symbolic Variables
Table of Contents
Declaring .
Factoring Polynomials .
Using pretty .
Expanding .
Simplifying .
Do I Have to Declare Symbolic? .
1
1
2
2
2
3
In the previous section we learned how to
Solving Equations Numerically
Table of Contents
What are Numerical Methods? .
Solving an Equation Numerically using fzero .
Choosing Well .
Why the Single Quotes? .
Is that it? .
1
1
2
2
2
Next we'll
Differentiation
Table of Contents
Using diff .
Higher Derivatives .
A Different Variable .
Wait, that Second Parameter? .
Plugging Stuff In - Using subs .
Plotting Derivatives .
1
1
1
2
2
3
Differenti
Math 206 Fall 2017 Project 1
Generated For: beiu1196
Covers:
This project covers up through and including Chapter 8 of the tutorial.
What to Submit:
For this project you will need to create and upload
format long;
mypw(3,3)
ans =
0
mypw(4,3)
ans =
1
mypw(1,5)
ans =
-1
mytaylor(@(x) sin(x),0,2,5)
ans =
0.933333333333333
mytaylor(@(x) 1./x,1,5,7)
ans =
-13107
mynewton(@(x) x.^2-7,3,4)
ans =
2.6457513
Math 206 Project 2
First Submission due Thu 26 September 2013 at 11:59pm
Second Submission due Sun 29 September 2013 at 11:59pm
Covers:
This project covers up through Chapter 15 of the tutorial.
What
Math 206 Project 3
First Submission due Thu 10 October 2013 at 11:59pm
Second Submission due Sun 13 October 2013 at 11:59pm
What to Submit:
For this project you will need to create and submit a collec
Math 206 Project 1
First Submission due Thursday 12 September 2013 at 11:59pm
Second Submission due Sunday 15 September 2013 at 11:59pm
Covers:
This project covers up through Chapter 7 of the tutorial
Script M-Files
Table of Contents
What is a Script M-File? . 1
A Simple Script M-File . 1
A Note about Script M-Files . 3
What is a Script M-File?
Before we proceed further consider that when you're wr
Differential Equations
Table of Contents
Introduction .
Having No Independent Variable. .
Initial Value Problems .
Plotting a solution. .
Compound Example .
An Example with Variables .
1
1
2
2
3
3
Int
Integration
Table of Contents
Indefinite Integrals .
Where's the +C? .
Definite Integrals .
Approximating Integrals .
Using quad .
1
1
1
1
2
Integration can be indefinite or definite. Matlab can do bo
Plotting Curves
Table of Contents
Using ezplot .
Changing the Window Size .
Equations .
An Alternate Command .
1
1
3
4
Using ezplot
A picture is worth 1000 words. Let's learn how to get Matlab to show
Storing Values
Table of Contents
Declaring Variables as Values .
Accessing Stored Values .
Altering Variables Depending on Themselves .
A Warning About Stored Variables .
Using ans .
Clearing the Vari