Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Computational Project for MATLAB: Defining Vectors, Matrices, and Plotting Functions - Pro, Study Guides, Projects, Research of Mechanical Engineering

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

Pre 2010

Uploaded on 02/10/2009

koofers-user-1cv
koofers-user-1cv 🇺🇸

10 documents

1 / 1

Toggle sidebar

Related documents


Partial preview of the text

Download Computational Project for MATLAB: Defining Vectors, Matrices, and Plotting Functions - Pro and more Study Guides, Projects, Research Mechanical Engineering in PDF only on Docsity! Computational Project # 1 Due February 12 1. Develop, debug, and test a program (MATLAB m-file) that for arbitrary m and n (input parameters): a) Defines vector 1 , 1, 1i ix i m − = = − …m using single loop. b) Define vector ( )11 1 cos , 1, 2 1j j y n π −  = − =   −   …j n using Matlab vector operations instead of using loop. c) Define two-dimensional array ( ) 21 sin , 1, , 1, 2ij i j y i m jπ = − = =    …a x using double loop. n… d) Define two-dimensional array 4 41 2 , 1, , 1, 4 3ij i j y 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) . 2. Using the Symbolic Math Toolbox create, debug, and test another program (MATLAB m-file) that a) finds first 5 terms of Taylor series expansion for ( )2cos tan 4x x π −     about x=0. b) differentiates the function ( ) 2sintan sin( ) xx e P.S. Email your code to compmeth@colorado.edu. 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.
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved