problems

profileAnildan
Lab1Manual_MATLABIntro.pdf

BME 4440L/6440L BIOMATERIALS LAB FALL 2021

Lab 1: MATLAB Introduction

Lab Report:

No formal lab report due. You can type or paste your MATLAB results into a Word document and

type your explanation for the functions along with the results.

Purpose:

The following are exercises to be completed and turned in for this lab. For Problems 1-4, explain

in a couple sentences what each function is actually doing, and then solve in MATLAB. Problems 5-7 are

to be solved with MATLAB.

Problems:

1. Use the following matrix G where referenced.

G =

0.6 1.5 2.3 −0.5

8.2 0.5 −0.1 −2.0

5.7 8.2 9.0 1.5

0.5 0.5 2.4 0.5

1.2 −2.3 −4.5 0.5

Explain what each expression means and solve each expression with MATLAB.

a.) a = G( : , 2 ) ;

b.) b = G(4 , : ) ;

c.) c = [ 10 : 15 ] ;

d.) d = [4 : 9 ; 1 : 6] ;

e.) e = [-5 , 5] ;

f.) f = [0.0 : 0.1 : 1.0];

g.) g = G (4 : 5, 1 : 3) ;

h.) h = G (1 : 2 : 5, :) ;

BME 4440L/6440L BIOMATERIALS LAB FALL 2021

2. Explain what each expression means and solve each expression with MATLAB.

a.) round(-2.6)

b.) fix(-2.6)

c.) floor(-2.6)

d.) ceil(-2.6)

e.) sign(-2.6)

f.) abs(round(-2.6))

g.) sqrt(floor(10.7))

h.) rem(15,2)

i.) floor(ceil(10.8))

j.) log10(100) + log10(0.001)

k.) abs(-5:5)

l.) round([0 : 0.3 : 2,1 : 0.75 : 4])

3. Explain what each expression means and solve each expression with MATLAB. Assume that w, x, and

y are the following matrices:

w = 0 3 2 7−

x = 3 1 5 7−

y =

1 3 7

2 8 4

6 −1 −2

a.) max (w)

b.) min (y)

c.) min (w, x)

BME 4440L/6440L BIOMATERIALS LAB FALL 2021

d.) mean (y)

e.) median (w)

f.) cumprod (y)

g.) sum (x)

h.) sort ( 2*w+x)

i.) sort (y)

4 Explain what each expression means and solve each expression with MATLAB. Assume that w, x, and

y are the following matrices:

w = 0 3 2 7−

x = 3 1 5 7−

y =

1 3 7

2 8 4

6 −1 −2

a.) std (w)

b.) std (x)^2

c.) std (y ( : ,2 ) )

d.) std (y)

e.) std (y).^2

5. Generate 100 points of the function below for values of x beginning at x = 0 and incrementing by 0.5:

y = 5x 2

BME 4440L/6440L BIOMATERIALS LAB FALL 2021

a.) Generate a linear plot of these data.

b.) Generate a log-log plot of these data.

c.) Compare the various plots and point out advantages and disadvantages of the

different forms.

6. Solve the following systems of equations using matrix division and inverse matrices using MATLAB.

   

   

−=+−−

=+−+

=−++

=+−+

  

  

=++

=++−

=+−

  

  

=−−

=++−

=−+

  

  

−=−−

=++−

=−+

 

  

=+

−=+−

1552103

124

16272

24

655

4623

70710

1

123

123

1

523

1023

3

32

4321

4321

4321

4321

321

321

321

321

321

321

321

321

321

21

21

xxxx

xxxx

xxxx

xxxx

xxx

xxx

xxx

xxx

xxx

xxx

xxx

xxx

xxx

xx

xx

7. Assume that we have the following data points: (see page 237)

Time, s Temperature, F

0.0 72.5

0.5 78.1

1.0 86.4

BME 4440L/6440L BIOMATERIALS LAB FALL 2021

1.5 92.3

2.0 110.6

2.5 111.5

3.0 109.3

3.5 110.2

4.0 110.5

4.5 109.9

5.0 110.2

a.) Generate a plot of Temperature as a function of time.

b.) Evaluate the values for temperatures at the following times using linear interpolation:

0.3, 1.25, 2.36, 4.48

c.) Compute the time values that correspond to the following temperatures using linear

interpolation:

81, 96, 100, 106