View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
maxima and minima

3.0 | 6 ratings Rate this file 7 Downloads (last 30 days) File Size: 13.2 KB File ID: #22200 Version: 1.1

maxima and minima



21 Nov 2008 (Updated )

M-files for obtaining extreme points is a set of data

| Watch this File

File Information

These are two similar programs. They operate to find coordinates and indices of extreme points in a set of x,y data. they are usful for a purposes ranging between finding positions where the first derivative is zero to obtaining envelops of signals. Example is given in the attached pdf file

MATLAB release MATLAB 6.5 (R13)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (13)
06 Jan 2012 Rakshit Kothari

Hey aasim, this fit perfectly for my project, i am using object signatures for recognition and this makes my plot smooth. thank you

05 Apr 2011 Ahmed Ahmed


29 Nov 2008 aasim Azooz

Thank Jos. I understand what you mean. I will keep your advice in mind. I think other folks and my self have made an issue out of silly thing. I will edit the file. Many thanks
Aasim Azooz

Comment only
28 Nov 2008 Jos (10584)

Jos (10584) (view profile)

Somehow, I feel you miss the point completely. It is perfectly acceptable to have a separate document describing your functions in detail. However, you have to be aware how people will use your function. When they type "help maxima" and nothing is returned, it is most likely they will never use it and even delete it. In the very best case they will modify the function to include a help section.

So, try to make a proper help section within the function itself using the comment symbol, and include a H1 line, the calling syntax and an example. In addition, you could refer to your pdf-document. Furthermore, comment your code, explaining in normal language what each statement is doing.

Note that comment lines do not affect the speed or execution of the code in any way. It is intended to assist the user, and the developer as well, when the need arises for understanding or updating the function.

Comment only
28 Nov 2008 aasim Azooz

Dear every one
I have been looking at all your comments. please do not take what I wrote out of context. I still maintain that few lines of green comments may do more harm to a five statments program than good. I think that the % sign is very useful in long codes but not as much in short ones. In my case, I have included all explaination and an example in the pdf file I do not know how to do that with the % if any of you can teach me how to do it, I shall be grateful to him. Otherwise, he can try to be fair at least. Thanks to all
Aasim Azooz

Comment only
26 Nov 2008 Duane Hanselman

If help text and comments contained inside an M-file do more harm than good, then I suggest that you make an official enhancement request to The Mathworks asking them to remove all such harmful text from the thousands of M-files they distribute with MATLAB. Even better yet, request that they eliminate the % symbol as the start of a comment in an M-file. That will make it impossible for anyone to include such harmful material in an M-file. The % symbol marking a comment might have been around for 25 years in MATLAB, but it is never too late to get rid of it.

Comment only
25 Nov 2008 Kenneth Eaton

The number of downloads is not a real measure of the QUALITY of the submission, merely the amount of CURIOSITY users have regarding your submission. Remember, many people can't help but stare at a car wreck.

You should heed the advice of the other commenters. Your statement that "comments do more harm than good" is incredibly foolish. You should look at how typical MATLAB files are written and modify your submission accordingly.

Comment only
25 Nov 2008 aasim Azooz

Dears Dr Anonymous and Duane Hanselman
Well I can easly add few comment but I will not green comments do more harm than good. It is a matter of taste. please Look at the download rate for the last four days. They changed my rank from 720 to 523.

Comment only
25 Nov 2008 Anon

Anon (view profile)

I agree with Duane,
I wouldn't like to search a pdf first before being able to use a function. You?

25 Nov 2008 Duane Hanselman

Dear aasim Azooz
The help belongs in the M-file itself, just as it appears in all functions distributed with MATLAB and all good files posted here. Why would a person want a thousand pdf files to document a thousand M-files?

25 Nov 2008 aasim Azooz

Dear Duane Hanselman
If you do not want the plot, you can close it or simply deactivate the plot command with %
Please go to the pdf file for instructions and help

Comment only
24 Nov 2008 Duane Hanselman

By including a plot command inside these functions, you force users to accept a plot of the results. Why do this when many users may not want a plot?
No help text or comments of any kind.
No error checking of any kind.
No use of vectorization.
Not much use for anyone except the author.

23 Nov 2008 Felix Zoergiebel

Sorry, I accidentally gave the three star rating. Well, since I rated it:
I tested the code, it works. However I'd recommend to rewrite the code with some find commands instead of the for loop. That's less code and executes faster.

29 Nov 2008 1.1

Comments are added describing the M-files and the function of each step

Contact us