Assignment 3
Assignment 3
< s
=
otherwise 0
3 t 3 -
3 ) (
t
t x b)
s
< s
< s
< s +
<
=
t 4 0
4 t 2 ) 8 2 (
2 t 1
1 t 1 - ) 1 (
-1 t 0
) (
2
6
1
3
2
2
6
1
t t
t
t
t y
2. Answer to the following questions:
a. Write a MATLAB function in an m-file called myfunc.m which represents the following
curve for f(t). The function is to have input vector t and output vector y.
b. Write a MATLAB program in an m-file which calls the function myfunc and plots the
returning f(t) within the interval [-1 7].
c. Using fplot command and the defined function, myfunc, plot f(t) within the interval [-1 7].
Do not forget to include labels and titles in your plots.
Note: please include all your MATLAB programs, m-files, functions, and plots in your
report.
5 2 t
y=f(t)
-8
12
t
3
+ t
2
+ t
3