
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A computational project for creating matlab m-files to define vectors and matrices using loops and vector operations, as well as plotting functions and their derivatives using the symbolic math toolbox. The project includes tasks such as creating subplots, 3-dimensional surface plots, and filled contour plots.
Typology: Study Guides, Projects, Research
1 / 1
This page cannot be seen from the preview
Don't miss anything!

a) Defines vector
i
i x i m
… m using single loop.
b) Define vector
1 cos , 1, 2 1 j
j y n
j … n using Matlab vector
operations instead of using loop. c) Define two-dimensional array
2 1 sin , 1, , 1, 2
a x … … n using double loop.
d) Define two-dimensional array
4 4 1 2 , 1, , 1, 4 3
ij i y^ j i^ m^ j
b x … …
using “meshgrid” Matlab command instead of using double loop.
n
e) Use subplot command to break the figure window into a 2-by-2 matrix of smaller sub-windows. f) Plot y vs. x in first sub-window if n=m , otherwise create an empty figure with axes and domain size defined x and y vectors and write an error message “Error: n /= m ”. Define the names for the axes using on-line commands and the figure title. Create legends. g) Plot two-dimensional array aij as 3-dimensional surface. Use two different styles for the surface: “ shading interp ” and “ shading faceted ” for two other sub-windows. h) In the forth sub-winow create a filled contour plot of two-dimensional array bij. Use jet as a colormap. For items (a)-(g) create a single function that performs all the tasks with n and m as input parameters. Run and test the program for ( n,m )=( 11,11 ), ( 21,11 ).
x x
about^ x=.
sin^2 tan sin( ) x e x
P.S. Email your code to [email protected]. The program that you send should be a working program All the codes will be checked whether they run or not. If they are erroneous, but run, points will be taken for the errors. If the code is not running (it has some syntax errors), an additional 25% will be taken out. The goal of this class is for you to be comfortable solving engineering problems. Please take your time and learn how to trust the computer.