Code covered by the BSD License  

Highlights from
smartnormalized

4.0

4.0 | 1 rating Rate this file 2 Downloads (last 30 days) File Size: 2.83 KB File ID: #17215

smartnormalized

by Ali Mohammad Razeghi

 

29 Oct 2007 (Updated 01 May 2008)

Normalizes a function to "unity".

| Watch this File

File Information
Description

Derives number of dimensions ( variables ) of given function then
normalizes it "unity".

Clarification: unity has different meanings in each dimensions e.g. for
one variable function the output function has a unit area between the
curve and x-axis in the interval that user defines, for two variables
function the output function has a unit volume between the surface and xy
plane in the intervals that user defines and so on.
Example:
 A = inline ( ' tan ( x ) + ( i * x ) + sin ( y ) + i * ( y ^ 2 ) + i * cos ( z ) + ( z ^ 2 ) ' ) ;
 B = smartnormalized ( A , [0 0 0.01] , [pi/4 pi/4 pi/4] , 'sym' )
 B =
    (2928464171262539/4503599627370496-1072148456816461/1125899906842624*i)*(tan(x)+i*x+sin(y)+i*y^2+i*cos(z)+z^2)

Required Products Symbolic Math Toolbox
MATLAB release MATLAB 7.2 (R2006a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
30 Oct 2007 John D'Errico

I'm pleased to see real progress in this author's work. Its not what I'd describe as perfect, but I can't always say that about my own codes either.

As I read through this code, I see error checks on the variables to help the user. I see an H1 line. There is good help (more on this later.) Use of the symbolic toolbox is documented. The internal comments are well done.

A couple of somewhat minor points - the help is spread throughout the code. So for help on the 5 argument version of this code, you must look down inside the code. You don't see that part using help. You must edit the code.

Next, I don't see why it is necessary to use dblquad or triplequad to do the integration for the 2-d or 3-d cases. They are adaptive numerical tools, as such are quite CPU intensive, especially for the 3-d case.

Finally, I'm not entirely sure about the use of the phrase "area normalization", even though I myself suggested it as an alternative. As applied to a possibly complex function, "area" seems not entirely appropriate to me, but a better word escapes me at the moment.

So as a whole, while not perfect, this is a good effort by the author. I hope & expect to see continued improvement from this author.

Please login to add a comment or rating.
Updates
01 May 2008

vectorization, commentation, clarification of "unity", memory using.

Tag Activity for this File
Tag Applied By Date/Time
normalization Ali Mohammad Razeghi 22 Oct 2008 09:33:09
function Ali Mohammad Razeghi 22 Oct 2008 09:33:09
distribution function Ali Mohammad Razeghi 22 Oct 2008 09:33:09

Contact us at files@mathworks.com