Rank: 1154 based on 110 downloads (last 30 days) and 9 files submitted

Ali Mohammad Razeghi

Islamic Azad University

Personal Profile:

I work on Experimental Solid State Physics And Solid State Physics Simulation. I try to find a good place for PhD Studies and improve my code structures. I hope that my code users, reviewers, and visitors help me for this two things.

Professional Interests:
Experimental Solid State Physics, Solid State Physics Simulation


Watch this Author's files


Files Posted by Ali Mohammad View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
12 Oct 2009 Screenshot Solid State Physics Simulation Pack_V 0.02 A Simple Pack of Tools for Plotting Lattices and Crystals and Calculating Their Properties. Author: Ali Mohammad Razeghi ccv, lattice, cplot, matrix, physics, plotting 37 0
  • 5.0
5.0 | 1 rating
15 Dec 2008 smartnonlinrgen finds the roots of a set of nonlinear equations Author: Ali Mohammad Razeghi mathematics, root, nonlinear 7 0
20 May 2008 smartconvert Tries to find a set of coordinates that function has simple relations between variables or finds the Author: Ali Mohammad Razeghi convert, simple, function, mathematics, general 5 0
20 May 2008 datashift Finds the maximum difference between numbers of a set then shifts the numbers up and down. Author: Ali Mohammad Razeghi data, shift, difference, elements, maximum 5 1
  • 4.0
4.0 | 1 rating
08 May 2008 incresearch Finds the intervals that function sign changes Author: Ali Mohammad Razeghi roots, root finding, sign change 7 2
  • 2.0
2.0 | 1 rating
Comments and Ratings on Ali Mohammad's Files View all
Updated File Comment by Comments Rating
29 Oct 2011 Solid State Physics Simulation Pack_V 0.02 A Simple Pack of Tools for Plotting Lattices and Crystals and Calculating Their Properties. Author: Ali Mohammad Razeghi Noureldin

20 May 2008 datashift Finds the maximum difference between numbers of a set then shifts the numbers up and down. Author: Ali Mohammad Razeghi D'Errico, John

This is a pretty specific tool, solving a specific problem. But it does what it says it does. It has got nice error checking, and fairly complete help, plus an example. Mlint found nothing to complain about.

The H1 line, i.e., the first comment line, was too short. In fact, the first sentence in the comments does perform the job of an H1 line, but it is spread over three comment lines in the help. Since lookfor only looks at that very FIRST line, I might have suggested an H1 line something like this:

% datashift: repairs a broken sequence of numbers, shifting the two pieces together

This is a short enough line that it will fit into a single comment line, but it is also descriptive as an H1 line.

One other point on the help. In my testing, I tried some sequences with several breaks in the sequence. datashift appears to look for the single largest break, repairing that by shifting the subsequences together. It will not find subsequences separated by several breaks of different sizes. This might have been more clearly explained in the help.

The code itself is not fully vectorized, not in itself a true flaw. But it could be simplified by the use of artful vectorization. For example, rather than the loop:

% Checks for complex numbers
for i = 1 : L

if imag ( A ( i ) ) ~=0
error 'A complex number(s) in the set has found.'
end % End of if loop.

end % End of for loop.

The author could as easily have done something like
if any(imag(A)) ~= 0

Or perhaps even simpler, just use a test like

is ~isreal(A)
error 'A complex number(s) in the set was found.'

Again, this was not really a flaw, more an issue of programming style. There are a few points where I did see nicely appropriate vectorizations used.

I do like the commenting style used by the author. Having many comments costs you nothing, so use them freely! You will appreciate them next year when you need to modify your code, or fix some bug that turns up. Well done here.

The issues I've pointed out are not really that serious ones, they did not bias my rating significantly downwards. I'll happily return and raise my rating to a 5 with a repaired H1 line, plus a comment in the help that says what happens when no single largest difference is identified.

I'll offer my commendations to the author for continuously improving his Matlab skills, as well as his codes on the FEX.

30 Oct 2007 smartnormalized Normalizes a function to "unity". Author: Ali Mohammad Razeghi D'Errico, John

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.

15 Oct 2007 newton_raphso uses Newton-Raphson method ( modified ) to find the root of a function Author: Ali Mohammad Razeghi Hanselman, Duane

See the detailed reviews of all other submissions made by this author. They apply equally well to this submission. Ali, please consider removing all of your submissions until you understand MATLAB better.

18 Sep 2007 interpolat finds brackets of x that contain sign changes of a function on the interval [ xmin , xmax ] and uses Author: Ali Mohammad Razeghi D'Errico, John

My thanks to Richard Brown for his accurate review. Most of my comments would just mirror his. This submission indeed needs very much improvement.

The help is poor, consistently so for this author. (I'm disappointed that this author has not improved his coding style given the many poor reviews.) While there are short descriptions of the parameters, they are woefully inadequate. For example, es is described as a stopping criterion. But what test is applied, we don't have any idea. maxit is the maximum number of iterations, but what is iterating? How many iterations is a reasonable number?

Worse, while the many parameters have default values, we don't have any idea what those defaults are. Worse yet, these defaults are poorly implemented. If you wish to set only the last variable to something other than its default value, you must set all the other variables too. And, since we don't know what the defaults for the other variables are, this is a real problem. This goes against the standard matlab paradigm for defaults.

I also agree with Richard's comments about the methods used, and am not at all impressed with the Gauss-Seidel method chosen. The algorithm itself is a bit suspect, not converging to any requested tolerances in my tests.

Poor programming styles are used throughout. For example, a Vandemonde matrix is generated using a doubly nested loop. Why not use the existing vander function? Even better, since this was created using the current release, use bsxfun to generate that matrix in one line, with NO loops at all.

Other loops are used for no good reason, where a simple vectorized statement is entirely appropriate.

The code is not terribly readable, lacking whitespace. While it does have many internal comments (a GOOD thing!), they are not always useful. Many comments merely name the loop variable, something that is usually clear anyway. Far more valuable would be a useful explanation of the method used, something that is totally lacking.

Other examples of poor coding style are the use of poor variable names. Use of a lower case "L" is a bad idea, as it makes your code virtually impossible to read. l looks too much like the number 1.

Even the name of the function is a poor, un-mnemonic choice. Why call a root finding code "interpolat"? If the next homework assignment by this author is truly an interpolation code, I might expect to see it called rootfind.m?

Next, this function lacks an H1 line. Its a necessary tool to enable the lookfor command. And since the name of this function is so un-memorable, one would think lookfor is a valuable thing.

Finally, mlint flags fully 15 different lines in this code. Many of those flags are problems worthwhile resolving.

As I said, this code needs vast improvement before I would even consider calling it fair. This is not to say the code is terrible, as I've seen far worse submissions on the FEX. While part of me wanted to rate this as "poor", it has barely enough redeeming characteristics to call it "needs improvement". But there are other codes I would recommend before this one.

Contact us