Exercise 1: Dot Product
The image shown below is a simple practice for the dot product function in Matlab. The Price is the price of the food alone; the total price includes tax.
Exercise 2: Finding the angle between two force vectors
The problem statement and solution written on a white board in class is shown below.
Code used in Matlab in order to solve the problem shown above.
The results are shown below, with the angle in radians as well as degrees.
Exercise 3: Finding the center of mass
In this exercise, we were given a set of components floating around in free space and we were instructed to find the center of mass of the system using Matlab. Shown below is the whiteboard problem statement and hand-written solution.
The image below is the code used in order to solve for the center of mass using Matlab.
Below is the graphical output of the center of mass problem.
Exercise 4: Inverse practice
In this exercise, we were instructed to create three matrices and find the inverse for each one using the inv() function as well as using ^-1 in order to show that both methods yield the same results.
These are the outputs from the exercise:
Inverse of matrix A
Inverse of matrix B
Inverse of matrix C
Exercise 5: Moment
In this exercise, we were given two points on an object and a force acting on it and we were instructed to find the moment about each point. We were also instructed to create a user input program that allows the user to enter a force and direction vector to find the moment. Shown below is the problem statement and hand-written example on the white board.
Below is the code used for solving this particular moment problem:
Shown below is the output generated from Matlab. Moment represents themoment about that particular point. iMoment represents the moment based on the user input for force vector and direction vector.
No comments:
Post a Comment