- Matlab has a very good reference and help system in itself. To get started, these sections in Matlab documentations can be very helpful.
- "MatLab", "Image Processing Tool Box", and "Statistics Tool Box".
- This book can be very good if one is planning to use Matlab with image processing.
- Digital Image Processing (3rd Edition) by Rafael C. Gonzalez and Richard E. Woods
- To program in Matlab, there are two things to be aware of. First the program should be easy to understand. Second the program should be modulated. To achieve these two goals, listed below are a few programming tips.
Matlab has very good tools for debugging, testing and profiling. Please checkout these tools in Matlab and use them often. For convenient programming and testing, here are some more tips.
- Use comments to explain the purpose or give a big picture of programs.
- Use meaningful variable names such that the program can be understood with little comments.
- Give each constant parameter a descriptive name.
Each function is designed to achieve one goal only.If two functions repeats simily works in part, extract that part to a function.Organize the functions and put them in a subfolder of the src/ directory.
- For example, write
- >> descriptive_name = 1;
- >> a_function(descriptive_name);
- but not,
- >> a_function(1);
- Your directory tree will look like
- During initial programming/testing, we can write in one test script file. Then we use the cell mode to run only part of the programs for detecting and correcting errors.
- The values of the variables can be examined in you desktop by switching to workspace.
- If there is really some illusive error, we can use the debugging tool for further testing.
- After the initial testing is finished, each segment of the program will be extracted to a function.
- Test the function again to correct any errors.
Thursday, May 26, 2011
Getting started with Matlab
Posted by Shaoying Lu at 8:43 AM