MATLAB Project 1

.docx

School

University of Alabama *

*We aren’t endorsed by this school

Course

238

Subject

Mechanical Engineering

Date

Jan 9, 2024

Type

docx

Pages

4

Uploaded by ChancellorGalaxyAlpaca15

Report
Olivia Campbell 12213131 MATLAB Project 1 Due 10/10/23 1. In this question, you will explore some basic commands in MATLAB. a. Try the following in the command window of MATLAB, and explain what these commands do: i. a=9 ii. b=pi/6 iii. c=5*sin(b)-sqrt(a) iv. d=exp(2) v. e=log(d) 1. These commands solve values for specified variables. Once the variables are assigned a value, they can be plugged into the following equations and functions. Using previous data, the commands can solve for the new specified variables. b. In MATLAB, we can define and plat a function on the interval [0,5] using the following commands: i. F=@(x) x.^3+x.^2+x+1
ii. X=0:0.1:5 iii. Y=f(x) iv. Plot(x,y) Explanation: 1. Define the function using the function handle in MATLAB. 2 Pick discrete x-values on the [0,5] with increments 0.1. 3 Compute the corresponding y-values. 4 Use the plot command to draw the graph. Please modify the commands and use them to plot the function y=e^x+xcos(x) on [0,3]. Make sure to include this figure in your report.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help