Tuesday, December 15, 2015

day 12 (lecture 12)

#1 this code doesn't do much

#2 This code changes the class type without changing the value


The second picture is the workspace

The rest of class we learned about cell arrays and structures which are like meta classes that allow someone to put different classes into a matrix. Like an array of matricies.

day 11(lecture 11)

#1 Kirchoffs loop rule
#2 another systems of equations problem but using the row echelon form

#3 water pump problem


day 10 (lecture 10)

#1 IN N OUT Burger Menu Cost
#2 find angle between vectors

#3 center of mass
*last column in Tot matrix should be the masses of all components

#4 a demonstration that inverse of matrix A x A is the identity matrix. And that they can be multiplied in any order

#5 My first Cross Product in Matlab :)

#6 Moment vector from force and distance vectors


Monday, December 14, 2015

day 9 (lecture)

This lecture had only two unique exercises. The repeated ones can be found in other posts


#1
a = [12 17 3 6] 
b = [5, 8, 3 1, 2, 3 2, 4, 6] 
c = [22 17 4] 


1) Assign to the variable x1 the value in the second column of matrix a. 
2) Assign to the variable x2 the third column of matrix b. 
3) Assign to the variable x3 the values in matrix b along the diagonal. 
4) Assign to variable x4 the first three value in matrix a as the first row and all the values in matrix b        as the second through fourth row. 
5) Assign to variable x5 the values in matrix c as the first column, the values in matrix b as columns        two through 4, and the values in matrix as the final column 
6) Convert matrix b to a column vector name x6 



#2

1) Create a 3 X 3 matrix of zeros
2) Create a 5 X 3 matrix of ones
3) Create a 4 X 6 matrix in which all the elements have a value of pi.
4) Use the diag function to create a matrix whose diagonal has value of 1, 2, 3.
5) Create a 10 X 10 magic matrix.
    a. Extract the diagonal from this matrix.
    b. Extract the diagonal that runs from lower left to upper right from this matrix.
    c. Confirm that the sums of the rows, columns, and diagonals are all the same.
6) Extract a 3 X 3 matrix from the upper left hand corner of the 10 X 10 matrix you just created. Is this also a magic matrix?




*Everything that has "ans" are all the sums of the magic square, the answer to the last question is no

day8 (lecture8) (HW 7)

We were learning for loops that day. This was a relatively short lecture and since this material was lost and since the HW was basically the same thing we did in class, I will only post the HW for this lesson.


#1



#2



#3




*ignore golden variable output for section 3

The first ans is the approximation and the second is the actual






day 7 (lecture)


#1 

The first function finds the elements of the numbers that are greater than 30 and how many are greater than 30. The next function was me doing the same thing using loops, however I only got the number of elements over 30 to work. 

#2

The rest does not work :((((((

Day6 (lecture)


#1 Rates of Diffusion




*top left= regular plot
*top right= semilogx
*bottom left= semilogy
*bottom right= log log

#2 comet 
*this was captured mid animation so the axis labels havent appeared yet. All one has to know is that Z axis is up and down

#3 meshgrid


#4 sphere