Start learning today, and be successful in your academic & professional career. Start Today!

Loading video...

Enter your Sign on user name and password.

Start learning today, and be successful in your academic & professional career. Start Today!

Loading video...

## Discussion

## Study Guides

## Practice Questions

## Download Lecture Slides

## Table of Contents

## Related Books

- MATLAB has a variety of functions for displaying and visualizing data in 3-D., either as lines in 3-D, or as various types of surfaces.
- In this session we are going to introduce plot3, mesh and surf for different 3-D plots, at the end of this session we are going to see some other special graphics capability of MATLAB as well.

Draw graphs of x^{2}, x^{3}, x^{4}, e^{x2} over interval of 0 < x < 4, using plot function and semilog function.

x = 0:0.001:4;

semilogy(x,x.^{∧} 2)

semilogy(x,x.^{∧} 3)

semilogy(x,x.^{∧} 4)

semilogy(x,exp(x.^{∧} 2))

semilogy(x,x.

semilogy(x,x.

semilogy(x,x.

semilogy(x,exp(x.

The initial heat over a steel plate is given by the function:

u(x,y)=80y^{2}e^{−x2−0.3y2}

Plot the surface over the grid defined by: −2.1 < x < 2.1, −6 < y < 6, where the grid width is 0.15 in both directions.

u(x,y)=80y

Plot the surface over the grid defined by: −2.1 < x < 2.1, −6 < y < 6, where the grid width is 0.15 in both directions.

x = -2.1:0.15:2.1;

y = -6:0.15:6;

for i = 1:numel(x)

for k = 1:numel(y)

U(i,k) = 80*(y(k).^{∧} 2).*(exp(-x(i). ^{∧} 2-0.3*y(k). ^{∧} 2));

end

end

mesh(U)

y = -6:0.15:6;

for i = 1:numel(x)

for k = 1:numel(y)

U(i,k) = 80*(y(k).

end

end

mesh(U)

Draw a graph of the population of the USA from 1790 to 2000, using the following model:

P(t)=[197273000/(1+e^{−0.03134(t−1913.25)})] Where t is the date in years.

Actual data (in 1000s) for every decade from 1790 to 1950 are as follows:

3929, 5308, 7240, 9638, 12866, 17069, 23192, 31443, 38558, 50156, 62948, 75995, 91972, 105711, 122775, 131669, 150697.

Superimpose this data on the graph P(t) (plot this data in circles and red, and do not join them with lines).

P(t)=[197273000/(1+e

Actual data (in 1000s) for every decade from 1790 to 1950 are as follows:

3929, 5308, 7240, 9638, 12866, 17069, 23192, 31443, 38558, 50156, 62948, 75995, 91972, 105711, 122775, 131669, 150697.

Superimpose this data on the graph P(t) (plot this data in circles and red, and do not join them with lines).

t = 1790:10:2000;

for i = 1:numel(t)

P(i) = 197273000/(1+exp(-0.03134*(t(i)-1913.25)));

end

t2 = 1790:10:1950;

reP = [3929 5308 7240 9638 12866 17069 23192 31443 38558 50156 62948 75995 91972 105711 122775 131669

150697]*1000;

plot(t,P)

hold on

plot(t2,reP,'rO')

for i = 1:numel(t)

P(i) = 197273000/(1+exp(-0.03134*(t(i)-1913.25)));

end

t2 = 1790:10:1950;

reP = [3929 5308 7240 9638 12866 17069 23192 31443 38558 50156 62948 75995 91972 105711 122775 131669

150697]*1000;

plot(t,P)

hold on

plot(t2,reP,'rO')

The spiral of Archimedes may be represented in polar coordinates by the equation:

r=aθ

Where a is some constant, write some command-line statements to draw the spiral for some value of r.

r=aθ

Where a is some constant, write some command-line statements to draw the spiral for some value of r.

a = 2;

q = 1.25;

th = 0:pi/40:5*pi;

subplot(2,1,1)

plot(a*th.*cos(th), a*th.*sin(th)), ...

title('(a) Archimedes') % or use polar

subplot(2,1,2)

plot(a/2*q.^{∧} th.*cos(th), a/2*q. ^{∧} th.*sin(th)), ...

title('(b) Logarithmic') % or use polar

q = 1.25;

th = 0:pi/40:5*pi;

subplot(2,1,1)

plot(a*th.*cos(th), a*th.*sin(th)), ...

title('(a) Archimedes') % or use polar

subplot(2,1,2)

plot(a/2*q.

title('(b) Logarithmic') % or use polar

A rather beautiful fractal picture can be drawn by plotting the points (x_{k}, y_{k}) generated by the following difference equations:

x_{k+1}=y_{k}(1+sin 0.7x_{k})−1.2√{|x_{k}|}

y_{k+1}=0.21−x_{k}

Starting with x_{0}=y_{0}=0. Write a program to draw the picture (plot individual points; do not join them).

x

y

Starting with x

x(1) = 0;

y(1) = 0;

for i = 2:1000

x(i) = y(i-1)*(1+sin(0.7*x(i-1))) - 1.2*sqrt(abs(x(i-1)));

y(i) = 0.21 - x(i-1);

end

plot(x,y,'.')

y(1) = 0;

for i = 2:1000

x(i) = y(i-1)*(1+sin(0.7*x(i-1))) - 1.2*sqrt(abs(x(i-1)));

y(i) = 0.21 - x(i-1);

end

plot(x,y,'.')

*These practice questions are only helpful when you work on them offline on a piece of paper and then use the solution steps function to check your answer.

Answer

Lecture Slides are screen-captured images of important points in the lecture. Students can download and print out these lecture slide images to do practice problems as well as take notes while watching the lecture.

- Intro 0:00
- Comet3 2:37
- Mesh Surfaces 3:02
- Visualizing Vector Fields 5:29
- Contour
- Voltage Field and Gradients
- Rotation of 3D Graphs
- Rotation Angles
- Polar Angle
- Pause Command
- Other Cool Graphics Functions 14:59
- Area
- Bar
- Compass
- Errorbar

I. Introduction | ||
---|---|---|

MATLAB Essentials, Part 1 | 8:36 | |

MATLAB Essentials, Part 2 | 7:39 | |

II. MATLAB Fundamentals | ||

Introduction to Programs | 6:42 | |

Arrays & Matrices | 7:06 | |

Operator, Expression & Statements | 13:26 | |

Repeating With For | 14:21 | |

Decisions, Part 1 | 14:35 | |

Decisions, Part 2 | 8:53 | |

Last Notes on MATLAB Introduction | 9:47 | |

III. Logical Vectors | ||

Logical Vectors, Part 1 | 11:23 | |

Logical Vectors, Part 2 | 11:40 | |

IV. Program Design | ||

Program Design & Algorithm Development | 19:36 | |

V. Graphics | ||

Graphics, Part 1 | 9:14 | |

Graphics, Part 2 | 17:20 | |

Graphics, Part 3 | 18:37 | |

VI. Loops | ||

Loops | 10:38 | |

While | 17:01 | |

VII. Project | ||

Projectile Problem | 16:33 | |

VIII. Function M-Files | ||

Function M-Files, Part 1 | 12:55 | |

Function M-Files, Part 2 | 14:14 | |

Function M-Files, Part 3 | 11:54 | |

IX. Graphics Continued | ||

More on Graphics | 11:13 | |

Graphical User Interface, Part 1 | 7:25 | |

Graphical User Interface, Part 2 | 9:33 | |

X. Dynamical Systems | ||

Dynamical Systems | 12:45 | |

XI. Simulation | ||

Examples of Simulation | 10:45 | |

XII. Numerical Methods | ||

Numerical Methods | 22:20 | |

XIII. Simulink | ||

Simulink | 9:37 |

## Start Learning Now

Our free lessons will get you started (Adobe Flash

Sign up for Educator.com^{®}required).Get immediate access to our entire library.

## Membership Overview

Unlimited access to our entire library of courses.Learn at your own pace... anytime, anywhere!