Search Comments and Ratings

go

Comments and Ratings

   
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. Author: James Tursa 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. Author: James Tursa 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
#define UINT16_TYPE uint16_t
#define INT32_TYPE int32_t
#define UINT32_TYPE uint32_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. Author: James Tursa 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.

12 Nov 2009 mpower2 - A faster matrix power function. mpower2 evaluates matrix to an integer power faster than the MATLAB built-in function mpower. Author: James Tursa Schena, Gianni

super... but only with square matrices as far as I understant
can it work also with vectors ?
regards, gianni

12 Nov 2009 polyvalm2 - A faster matrix polynomial evaluator polyvalm2 evaluates a polynomial with a matrix argument faster than the MATLAB function polyvalm. Author: James Tursa Luong, Bruno

Neatly coded. How often do you see a Matlab stock matrix function get beaten in speed?

11 Nov 2009 polyvalm2 - A faster matrix polynomial evaluator polyvalm2 evaluates a polynomial with a matrix argument faster than the MATLAB function polyvalm. Author: James Tursa Tursa, James

Bruno: Done. Thanks for the suggestion. polyvalm2 now keeps all the intermediate calculations and the answer as sparse for sparse inputs.

10 Nov 2009 polyvalm2 - A faster matrix polynomial evaluator polyvalm2 evaluates a polynomial with a matrix argument faster than the MATLAB function polyvalm. Author: James Tursa Luong, Bruno

I wish James could do a treatment for SPARSE matrix, because initialize an intermediate matrix with EYE is sometime not an option with large (sparse matrix).

15 Aug 2009 Fortran Logical mex functions Fortran mex routines for converting logicals to/from MATLAB mxArray variables Author: James Tursa 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.

12 Jun 2009 bsxfun bsxfun is a functional substitute for MATLAB intrinsic of the same name Author: James Tursa Tursa, James

A better bsxfun substitute can be found here by Doug Schwarz:
http://www.mathworks.com/matlabcentral/fileexchange/23005

21 Apr 2009 Fortran Logical mex functions Fortran mex routines for converting logicals to/from MATLAB mxArray variables Author: James Tursa Clark, Thomas

Incidentally, I got this to work in Linux (openSUSE10.3 with gcc 4.1.2 compiler). All I needed to do was change the extensions:
testLogicalFunctions.for becomes
testLogicalFunctions.F90
and
mxLogicalFunctions.for becomes
mxLogicalFunctions.f
Why? Something to do with recognising which files are include files and which aren't (there's no standard include in FORTRAN).

21 Apr 2009 Fortran Logical mex functions Fortran mex routines for converting logicals to/from MATLAB mxArray variables Author: James Tursa Clark, Thomas

Wow, this just got me out of a very nasty fix (I came to the end of 400 lines of Fortran, then realised I couldn't pass the logical result back!).

Thanks, James, 5*

Although, if I were nit-picking, I probably wouldn't have added the type definitions of mwSize etc - I think to prevent confusion it'd be better to throw an error if they aren't defined - and keep their definitions all in one place (typically the fintrf.h file).

13 Nov 2008 swapbytes C-mex function swapbytes(X1,X2,...) reverses byte ordering of each element, little-endian values to/from big-endian Author: James Tursa Pei

15 Oct 2008 bsxfun bsxfun is a functional substitute for MATLAB intrinsic of the same name Author: James Tursa ZOU, Wilman

can i use this function in Matlab 7.0 ?
I only have this version .

Thank you ~~

24 Sep 2008 bsxfun bsxfun is a functional substitute for MATLAB intrinsic of the same name Author: James Tursa Vavey, Ivan

You can use repmat for physically expand dimensions instead writing a mex file. The key point to use bsxfun is memory concerns.

31 Jul 2008 Fortran mex: mxCopyCharacterToPtr and mxCopyPtrToCharacter Drop in replacements for the Mathworks supplied functions of the same names that do not work. Author: James Tursa Tursa, James

Just got a report that these may not work in Compaq Visual Fortran ... I am looking into it. My original tests were done using Intel Fortran.

12 Feb 2008 bsxarg bsxarg returns the physically expanded arrays associated with bsxfun Author: James Tursa Tursa, James

Thank you for your comments. Regarding BSXFUN, I did in fact look at the NG and found a recent thread where a user requested help on a replacement for BSXFUN. There were no responses mentioning any kind of generic solutions using REPMAT, only specific solutions for OP's particular problem. Then I searched the FEX for "bsxfun" and found only one function, REINDEX, available, and that one did not do the complete job. So I assumed that this function was not available in the FEX and wrote a solution. I have since been informed that there is another solution, genop, posted by Douglas Schwarz (file 10333), that essentially duplicates the BSXFUN function. Unfortunately, this does not show up in the search when you look for "bsxfun" in the FEX, so there may be many users (such as me) who searched but couldn't find it. You mention that you know of many solutions using REPMAT. Please give me the links to them so that I can examine them and compare them with my code. I would be more than glad to withdraw my BSXFUN submission if there are already better methods available. Thanks.

11 Feb 2008 bsxfun bsxfun is a functional substitute for MATLAB intrinsic of the same name Author: James Tursa Tursa, James

Thank you very much for the file links. It's kind of funny how this happened. A earlier NG post asked for a bsxfun replacement and there were no replies in this thread giving solutions in the FEX. So I searched the FEX for bsxfun and only found one function, reindex, that didn't do the complete job. So I figured there must be a need for this and wrote this replacement and posted it. But now that I have posted it, several people have come forward saying it is not needed because of the earlier solutions already in the FEX. That is fine, and I will happily withdraw my files if they are not needed. But if I had a hard time finding these other solutions, so will other people. Right now, the only files that result from a "bsxfun" search in the FEX are my files and the reindex file. Maybe you could add the "bsxfun" search word in your file posts so people like me can find them. If people can't find them they can't use them. I will download the ones I have been made aware of to compare with mine. Thanks again!

11 Feb 2008 bsxfun bsxfun is a functional substitute for MATLAB intrinsic of the same name Author: James Tursa Schwarz, Doug

Check out file 10333. I wrote it before bsxfun came out, but it's a drop-in replacement and does not replicate any data to perform its magic. It also will usually be slower than bsxfun.

You might also be interested in <http://www.frontiernet.net/~dmschwarz/genops.html&gt;.

11 Feb 2008 bsxarg bsxarg returns the physically expanded arrays associated with bsxfun Author: James Tursa (us) Schwarz, Urs

users who do not have BSXFUN could also use one of the many(!) solutions found on CSSM (ML's NG), which typically uses a simple REPMAT engine...
us

 

MATLAB Central Terms of Use

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