 channelflow.org

Site Tools

gibson:teaching:fall-2014:math445:exam1-sampleprobs

Sample Matlab problems for Math 445 exam 1

Write 0.0000145 in compact scientific notation.

What is 4.56e+3 in decimal notation?

Give an example of a calculation that returns Inf.

Give an example of a calculation that returns NaN.

What would the output be from the expression "x = 4; x == 3"?

What would the output be from the expression "x == 4; x = 3"?

Write Matlab code that would solve the following eqns
3x + 4y = 0
2y - x  = 1

Given your code to the above problem, write Matlab code that would
confirm the correctness of the numerically computed solution.

Write Matlab code that would assign a random 5 x 3 matrix with
normally distributed components to the variable C and then set
its 2nd column to zero. Try to do this in two lines.

Write Matlab code that would assign the 1st, 4th, and 5th rows of
C into a 3 x 3 matrix A. Try to do this in one line.

Write Matlab code that would assign the 5 x 5 identity matrix to
the variable I.

Write Matlab code that would compute the values of the polynomial
4x^3 + 2x -7 at 100 evenly spaced gridpoints between -1 and 1.

Write Matlab code that would compute the values of the polynomial
4x^3 + 2x -7 at gridpoints between -1 and 1 with steps of 0.01.

Given vectors x = [2 3 4] and y = [0 -1 5], what would be the value
of

x == y
x ~= y
x > y
x < y
~y
x & y
x | y
xor(x,y)

Write Matlab code for constructing a row vector with elements 4 5 1 2.

Write Matlab code for constructing a column vector with elements 4 5 1 2

Write Matlab code for extracting the odd-numbered columns of the matrix A.

Write Matlab code for extracting every third row of the matrix A.

Write Matlab code that assigns a 3 x 4 matrix of 11's to the variable A.

Write Matlab code that sets the 1st, 3rd, and 4th columns of a 3 x 4 matrix A to zero.

Write Matlab code that computes the mean of the even-numbered components of vector v.

Write Matlab code that computes the sum of the odd integers between 0 and 100.

Write Matlab code that sets the variable M to the number of rows of matrix A.

Write Matlab code that sets the variable N to the number of columns of matrix A.
gibson/teaching/fall-2014/math445/exam1-sampleprobs.txt · Last modified: 2014/09/30 06:48 by gibson

Page Tools 