Docsity

Matlab Image Processing: Creating M-Files and Functions, Assignments of Mathematics

Toggle sidebar
bg1
Mathematics of Image Processing
Matlab Session #2
Due: Thursday, October 26
1. Help and creating m-files
This Matlab session will concentrate and using help on making m-files. If you
installed them there is an html helpfile system and complete manual in pdf format.
Command line help, editor and other useful commands
help a list of help topics
help topic help on a given topic
help m-filename print the help comments at the beginning of m-filename
(look at handouts)
helpwin window of help topics
helpdesk brings up html and pdf help system in web browser
edit bring up the matlab editor-debugger
diary filename write commands and out put to filename
diary off shut off the diary
In the windows version help is available from the menu system, as well as
invoking the editor.
Comments for Matlab scripts should contain the name of the file or scripts
an brief explanation of what it does and in the case of a function file a usage
statement, with a description of the parameters.
2. Warm up exercise
1. Write an m-file (function file) that takes two matrices of the same size and
computes the dot product. Be as elegant as can. Put in help comments at
the top. Turn in the printed out file and example calculation.
3. Signals
2. Write an m-file (function file) that creates a rectangular (1-D) pulse of area
1defined on 0 ≤t≤1 of width w, starting at aand ending at a+w. The last
pf2

Partial preview of the text

Download Matlab Image Processing: Creating M-Files and Functions and more Assignments Mathematics in PDF only on Docsity!

Mathematics of Image Processing

Matlab Session

Due: Thursday, October 26

1. Help and creating m-files

This Matlab session will concentrate and using helpon making m-files. If you installed them there is an html helpfile system and complete manual in pdf format.

Command line help, editor and other useful commands ics helpa list of helptop help topic helpon a given topic help m-filename print the help comments at the beginning of m-filename (look at handouts) helpwin window of help topics helpdesk brings up html and pdf help system in web browser edit bring upthe matlab editor-debugger diary filename write commands and out put to filename diary off shut off the diary

In the windows version helpis available from the menu system, as well as invoking the editor. Comments for Matlab scripts should contain the name of the file or scripts an brief explanation of what it does and in the case of a function file a usage statement, with a description of the parameters.

2. Warm up exercise

  1. Write an m-file (function file) that takes two matrices of the same size and computes the dot product. Be as elegant as can. Put in help comments at the top. Turn in the printed out file and example calculation.

3. Signals

  1. Write an m-file (function file) that creates a rectangular (1-D) pulse of area 1defined on 0 ≤ t ≤ 1 of width w, starting at a and ending at a+w. The last

act of the function file should plot the pulse on square axes with the t-axis showing 0 ≤ t ≤ 1 as the domain of the function. Hand in the commented m-file.

  1. Write an m-file (function file) to create the model 1D wave form EN,k. Put in helpcomments at the topand then hand in the printed out file.

4. Images

  1. Write an m-file that creates a 128 Ɨ 128 image consisting of a white cross on a black background. The cross is centered with equal height and width and the arms of equal thickness. The script should display the cross.
  2. Write an m-file to create the 2D pure wave form Em,n.k,l. Hand in the com- mented file.
  3. Let m, n be any integers greater than 1. Write an m-file that cycles through all 0 ≤ k 1 , k 2 < m and 0 ≤ l 1 , l 2 < n, and prints out those quadruples(k 1 , l 1 , k 2 , l 2 ) for which Em,n.k 1 ,l 1 Ā· Em,n.k 2 ,l 2 = 0. The number m and n must be editable parameters at the beginning of the script. Hand in the script.
  4. What do you conclude from Question #6.