| Date | File | Comment by | Comment | Rating |
|---|---|---|---|---|
| 21 Nov 2009 | IEEE 754r Half Precision floating point converter Converts MATLAB or C variables to/from IEEE 754r Half Precision floating point bit pattern. | Tursa, James | Also this: #include <stdint.h> |
|
| 21 Nov 2009 | IEEE 754r Half Precision floating point converter Converts MATLAB or C variables to/from IEEE 754r Half Precision floating point bit pattern. | Tursa, James | I just got a report from a 64-bit linux user that the ieehalfprecision.c code did not work as posted, but he did get it to work by changing some types as follows: #define INT16_TYPE int16_t
I do not have a 64-bit system to test with, but I would assume this works as long as your compiler supports the int16_t etc types. |
|
| 12 Nov 2009 | mpower2 - A faster matrix power function. mpower2 evaluates matrix to an integer power faster than the MATLAB built-in function mpower. | Tursa, James | Gianni: Raising to a power with matrix multiplies is not mathematically defined for non-square matrices. Hence mpower2 (and MATLAB's own mpower) do not support this operation. For vectors, an operation that *is* supported in MATLAB is the element-wise power using the .^ operator. |
|
| 11 Nov 2009 | polyvalm2 - A faster matrix polynomial evaluator polyvalm2 evaluates a polynomial with a matrix argument faster than the MATLAB function polyvalm. | Tursa, James | Bruno: Done. Thanks for the suggestion. polyvalm2 now keeps all the intermediate calculations and the answer as sparse for sparse inputs. |
|
| 01 Sep 2009 | Sin Cos 01 Find the zero and one degree values. | Tursa, James | Wow, I think I am finally getting this stuff. I have to admit it took be awhile to get the meaning of your other posts, but this one for some reason just stood out. These lines from your description were the key: POSitive half unity: 51
After that it was simply putting this together with both of these lines: X = sin(360°)
to get that this was a POSitive Program Of Sines (POS), or POS POS! Yeah, I finally got it! So I think you should re-title this submission as: POS POS: Sin Cos 01 |
|
| 28 Aug 2009 | The Four Zero System Circle: the 50.5 business. | Tursa, James | I had a hard time understanding what kind of Program this is. There is so much going on. I waded through all of your descriptions without grasping the meaning. Is it a Program Of Zeros, a Program Of Degrees, etc. etc.? What finally cleared things up was the last two lines of your description: The SUM of the four circle equilibrium points is always 742°. The circle equilibrium solution more one is always 7 times the zero of the four equilibrium points less the SUM of the four circle equilibrium points. Aha! SUM! So I finally understood ... this is a Program Of Sums (POS). It would help others to understand your code if you updated the title to reflect this. So maybe change the title to: POS: The Four Zero System |
|
| 28 Aug 2009 | mexSparseLogical0Diag Change all the elements on the main diagonal of a logical sparse matrix to 0. | Tursa, James | A few suggestions for improvement: 1) Don't use bool to point to the MATLAB logical data. MATLAB supplies a data type for this, mxLogical. Using bool only sets you up for an unexpected failure on machines where sizeof(bool) is not 1. 2) Don't use nz to allocate the memory for the new array. There might be a lot of wasted space involved in the input array and there is not point in propagating that waste. Instead, just go get the actual number of current non-zero elements and use that, since you know your result will not be larger than this. e.g., mwSize n, n2;
3) There is no code to realloc the memory if a large percentage was reset to zero. e.g., an input matrix that is nearly the same as an identity matrix. Although not an error, you might think about including this. 4) I know you supplied an m-file with the help (very good), but it might be good to copy the calling info into the cpp source file so that a user can have this all in one file when editing the source. Again, not an error but it helps others to read your code. 5) Your nlhs test isn't the best, as it doesn't cover some possible erroneous inputs (e.g., what if user tries to fill two output variables?): if (nlhs > 0)
A better method is as follows: // at the beginning of your code:
// at the end of your code
i.e., at the end of your code don't do any test, just set plhs[0]. That way it will work if the user doesn't try to set the result to any variable ... in that case the result simply goes into ans. This always works, even if nlhs == 0. 6) You might consider making this a self-building mex routine. For an example of this, see one of my submissions, e.g., http://www.mathworks.com/matlabcentral/fileexchange/22239 7) With some very minor tweaking, you could also supply a C source code version so the users that only have access to the supplied lcc compiler can use this out of the box. The code appears to work fine, and is indeed much faster than a loop. I would probably rate it a 3 at this point, but I will wait for author's response to my comments before rating and may go higher. |
|
| 20 Aug 2009 | MATLAB rooms KMN Color simulation of the neural instants physicity. | Tursa, James | Like previous submissions, I think you have another naming problem here. This is obviously a Profundity submission, but a Profundity of *what*? Fortunately, this can easily be obtained from these few lines near the top of your description: red profundity = 0
By looking at the units used following your profundity lines, it becomes obvious that this is a Profundity Of Seconds, or POS. So you should rename the title of your submission to: POS: MATLAB rooms KMN |
|
| 15 Aug 2009 | Fortran Logical mex functions Fortran mex routines for converting logicals to/from MATLAB mxArray variables | Tursa, James | Thanks for the 5* rating. The #define for mwSize is needed for older versions of MATLAB that do not have this. That way the same source code can be used with either newer or older versions. I am a bit surprised that the .for extension didn't work ... I had no idea there was a Fortran compiler out there that didn't know what to do with a .for file! But this is good to know. In the future I will use .f extensions (or .f90) for my Fortran submissions. |
|
| 14 Aug 2009 | The Half: Pi NaN Values: 3 functions | Tursa, James | P.S. I had to use the Urban Dictionary to look up the meaning of "boh" |
|
| 13 Aug 2009 | The Half: Pi NaN Values: 3 functions | Tursa, James | Well, if you don't understanding my reasoning don't worry about it. Just change the name and title to PoS and everyone will be happy. |
|
| 11 Aug 2009 | The Half: Pi NaN Values: 3 functions | Tursa, James | The problem is the description and the name. In your description above, the Infinite^2 (squared) formula appears before any of your half formulas. And in the PoH.m file itself the term square appears many times, and the formula A = B --> Pi = D^2 / N^2 appears, all prior to any of the half formulas. So using H in your file name and using Half in your submission title is misleading. You should be using S for "square" instead. So you should rename this file PoS.m, and change the title of this submission to PoS: Pi NaN instead of Half: Pi NaN, and resubmit an update to this. Otherwise it is too hard for me (and probably others) to understand. |
|
| 10 Aug 2009 | The Half: Pi NaN Values: 3 functions | Tursa, James | The PoH function name may be mis-named. It looks like the beginning operations in the PoH.m file deal with squares, not halves. So maybe this should be renamed PoS.m? |
|
| 06 Aug 2009 | Mersenne Twister Mersenne Twister uniform pseudo-random number generator. | Tursa, James | To Joe Bunda: The included lcc is a C compiler, not a C++ compiler. You need a C++ compiler to compile twister.cpp. I did a quick look at the code and it looks like it wouldn't take much to convert it to a C routine that lcc would accept. To Peter Perkins: Do you plan on including a C version in a later update for people without a C++ compiler? If not, would you mind if I made a go at it? |
|
| 15 Jul 2009 | Function to Convert between DCM, Euler angles, Quaternions, and Euler vectors Function which will convert any rotation data of 4 types: DCM, Euler Angles, Quaternions, and Euler | Tursa, James | After comparing this submission with others in the FEX, I feel the need to bump my rating up. |
|
| 15 Jul 2009 | Euler angles to Quaternion Conversion (for six basic sequence of rotations) Allowed rotations sequences: xyz, xzy, yxz, yzx, zxy, zyx | Tursa, James | This submission has the following problems: 1) The code only covers six of the twelve possible triple rotation sequences. It leaves out the xyx, xzx, yxy, yzy, zxz, and zyz sequences. 2) Typing 'help eulertoquat' doesn't give you much of anything useful. Only a brief description of the function is given. All of the critical necessary information that should be in the help (quaternion convention (is scalar first or last?, etc), what units are acceptable for the euler angles, what order are the arguments, etc, etc) are not displayed. You have to manually edit the file eulertoquat.m to discover all of this. 3) The supplied testeuler2quat.m file doesn't work at all. First, it clears your command window, closes everything, and clears your workspace (very bad). Then it exits with an error because the function it calls, namely euler2quat, does not match the actual function name in the submission, eulertoquat. After changing the testeuler2quat.m file so that it called eulertoquat, it bombed again. This time because the number of output arguments did not match up. So after fixing that up, it bombed *again*. This time because the quaternion multiply routine func_QuatMult was missing ... it did not match the supplied function quaternionmul.m. So after fixing *that* up the test routine finally ran, but the results are pretty much useless as a test. Other than checking to see that the norm of the result is 1, nothing is supplied to check the correctness of the result. 4) There is no inverse function supplied. For example, a quattoeuler.m function would be appropriate. That would at least allow the user to check the results for consistency. 5) The code is not written as efficiently as it could. e.g., the current code creates several temorary variables, does the multiply into more temorary variables, and then gathers up the temorary variables and concatenates them into a single result to return. But by simply preallocating the quaternion result and then putting the calculation results directly into the return variable I was able to save about 5% off the running time. 6) The code is not vectorized! That is, you cannot input a vector or matrix of inputs and get a vector or matrix of outputs. You would have to call this function in a loop to get the results for a vector or matrix of inputs. 7) I don't usually question other people's ratings, but in this case I must. How can this submission possibly get 4 and 5 stars from others when it doesn't even run out of the box? "... easy to use ..." ??? What is going on here? I spot checked a couple of cases against other code I have (see below), and I did check the formula used for the quaternion multiply, and it appears to be correct. But if you want to see a *much* better submission for converting between quaternions, direction cosine matrices, and euler angle sequences that *is* vectorized and *does* have a useful help, I highly advise that you download this other submission by John Fuller: http://www.mathworks.com/matlabcentral/fileexchange/20696 James Tursa |
|
| 12 Jun 2009 | bsxfun bsxfun is a functional substitute for MATLAB intrinsic of the same name | Tursa, James | A better bsxfun substitute can be found here by Doug Schwarz:
|
|
| 28 May 2009 | Hexadecimal to binary converts a hexadecimal string of just about any length to the proper binary equivalent | Tursa, James | This function has several problems, hence the low rating. - No help included
If you pass this function some invalid text like 'garbage', it will happily give you an answer with no warning whatsoever that your input is junk. Or if you pass it an array like ['abc';'def'], it will not process the 2nd line. |
|
| 06 Jan 2009 | FAST K-NEAREST NEIGHBORS SEARCH Simple but very fast algorithm for nearest neighbors search. Supports KNN and radius search. | Tursa, James | To Matt Dash: lcc is a C compiler, not a C++ compiler, so you should not expect lcc to compile cpp files. |
|
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.
Contact us at files@mathworks.com