How do you write a FUNTION-M file?

Please give me an example of a FUNCTION code whereby image is convert to greyscale and to binary scale and going through salt & pepper filtering. thank you:)

답변 (1개)

Wayne King
Wayne King 2012년 9월 17일
편집: Wayne King 2012년 9월 17일

0 개 추천

Your title is not an accurate description of your post. Your post is asking somebody to write specific code for you, not a general question about how to write a function.
If you have the Image Processing Toolbox, please look at imread.m, imnoise.m, and medfilt2.m.
There are examples there of filtering salt & pepper noise. medfilt2.m will handle various classes of input image.

댓글 수: 3

Esther
Esther 2012년 9월 17일
편집: Esther 2012년 9월 17일
sorry about the description of post. I just want to know how do i even start a function M-file. like, function Img = getimage(Filename) how to do make this work. i need more examples, tutorials to know more about it.
Jan
Jan 2012년 9월 17일
@Esther: Please read the "Getting Started" chapters of the documentations, which is displayed by tyoing "doc" in the command window. Creating and calling a function belong to the very basics and a forum cannot replace a deep study of the documentation.

이 질문은 마감되었습니다.

질문:

2012년 9월 17일

마감:

2021년 8월 20일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by