Professional Documents
Culture Documents
Lab tutor : Yao Zhang, Shenghua ZHONG Email: zsh696@gmail.com csshzhong@comp.polyu.edu.hk Lab 4: Nov 30, 2011
1
Outline of Lab 4
Some important reminders of final project Some important steps and information of final project How to debug the user defined function
Please try your best to finish the project and submit it on time !
Don't make any modification of the provided functions expect Compress.m and Decompress.m.
Don't read the image file when you modify Compress.m and Decompress.m, otherwise, you will get zero point in the final project.
6
the word function, one or several variables that defines the function output, a function name, and one or several variables used for the input argument. Save the function as M-file using the same name in your function
Some examples:
function output = my_function(x)
function [output1, output2] = my_function(x1,x2,x3)
Hints: The function name and the names of the input and output variables are arbitrary and selected by the programmer, but the word function can not be changed.
7
Save above commands into an M-file and then type the below commands in command window to observe the results: >> a=4; >> poly(a) >> b=1:5; >> poly(b)
They like a black box (user only know the input and output parameters)
10
11
12