Search Comments and Ratings

go

   
Date File Comment by Comment Rating
05 Feb 2015 CopyMask Fast linear indexing Author: Jan Simon

Jan Simon (view profile)

Rob Campbell

Rob Campbell (view profile)

Yup, also a good speedup on 2014a.
@TMW, is it possible to incorporate these methods?

>> X = rand(8000,8000);
>> tic, CopyMask(X, X > 0.2); toc
Elapsed time is 1.696195 seconds.
>> tic, X(X > 0.2); toc
Elapsed time is 4.824547 seconds.

5
04 Feb 2015 CStr2String Fast concatenation of cell strings to a string as C-Mex Author: Jan Simon

Jan Simon (view profile)

Christopher Harris

Very slick. This is orders of magnitude faster than any matlab alternative I could find.

5
04 Feb 2015 WindowAPI Set figure size, top-most, transparency and pixel mask, multi-monitor etc by Windows API Author: Jan Simon

Jan Simon (view profile)

Udit Gupta

Excellent! Saved me hours of coding this myself.

5
02 Feb 2015 DGradient Gradient of arrays as fast C-Mex Author: Jan Simon

Jan Simon (view profile)

Jan Simon

Jan Simon (view profile)

@mehrnaz baradaran: The C-file must be compiled before it can be used, as described in the help section. If you do not want to install a compiler, you can download a pre-compiled MEX-file from the mentioned download page. Then only the MSVC-distributables might be needed, if you did not install them with any other software before.

Comment only
31 Jan 2015 DGradient Gradient of arrays as fast C-Mex Author: Jan Simon

Jan Simon (view profile)

mehrnaz baradaran

how could i use this file?
it conclude 3 file 2 of them is fuction and the other one doesnt run

Comment only
25 Jan 2015 WindowAPI Set figure size, top-most, transparency and pixel mask, multi-monitor etc by Windows API Author: Jan Simon

Jan Simon (view profile)

Vishnu

http://www.mathworks.com/matlabcentral/fileexchange/49149-matlab-loadlibrary-user32-dll-for-windows-functions-in-one-class

check my way of load library... undocumented

5
15 Jan 2015 UniqueFuncNames Check uniqueness of function names Author: Jan Simon

Jan Simon (view profile)

Randall Plate

I just had an issue where a basic Matlab function (fir1) was working without any error messages but not producing correct output. Took me a while to figure out it was because a subfunction it was calling was being overridden by another function my path. This tool is exactly what I was looking for to check for other instances where this might be happening and going undetected.

5
12 Jan 2015 WindowAPI Set figure size, top-most, transparency and pixel mask, multi-monitor etc by Windows API Author: Jan Simon

Jan Simon (view profile)

Patrik Andersson

5
05 Jan 2015 DateStr2Num Convert date string to date number - C-Mex: much faster than DATENUM Author: Jan Simon

Jan Simon (view profile)

Echidna

reading in large csv-files with dates in the first column turned out to be extremely slow due to the datenum function and this file save the day

5
30 Dec 2014 CStrAinBP Overlapping elements of 2 cell strings. 10-20 times faster than INTERSECT/ISMEMBER/SETDIFF. Author: Jan Simon

Jan Simon (view profile)

Jan Simon

Jan Simon (view profile)

@Hoi Wong:
Intersect:
AB = A(CStrAinBP(A,B));
For SETDIFF, UNION and SETXOR an equivalent tool CStrisAinB is more useful, which replies a logical vector. I'm going to publish it soon.

Comment only
25 Nov 2014 CStrAinBP Overlapping elements of 2 cell strings. 10-20 times faster than INTERSECT/ISMEMBER/SETDIFF. Author: Jan Simon

Jan Simon (view profile)

Hoi Wong

Hoi Wong (view profile)

5
25 Nov 2014 CStrAinBP Overlapping elements of 2 cell strings. 10-20 times faster than INTERSECT/ISMEMBER/SETDIFF. Author: Jan Simon

Jan Simon (view profile)

Hoi Wong

Hoi Wong (view profile)

Great tool. Can you suggest how to implement setops (intersect/setdiff/union/setxor) using CStrAinBP that has the same behavior as the native setops that does unique() without any major hit in performance?

Thanks.

Comment only
17 Nov 2014 WindowAPI Set figure size, top-most, transparency and pixel mask, multi-monitor etc by Windows API Author: Jan Simon

Jan Simon (view profile)

Abdunnoer

Thanks for the great work
changed
mex('-O', 'WindowAPI');
to
mex('-O', 'WindowAPI.c');

cause it did`nt find file

Comment only
11 Nov 2014 DataHash MD5 or SHA hash for array, struct, cell or file Author: Jan Simon

Jan Simon (view profile)

Noam Greenboim

Well written, good running time

5
01 Nov 2014 WindowAPI Set figure size, top-most, transparency and pixel mask, multi-monitor etc by Windows API Author: Jan Simon

Jan Simon (view profile)

Jan Simon

Jan Simon (view profile)

@Katharina: What about:

nMonitor = size(get(0, 'MonitorPositions'), 1)

Comment only
27 Oct 2014 WindowAPI Set figure size, top-most, transparency and pixel mask, multi-monitor etc by Windows API Author: Jan Simon

Jan Simon (view profile)

Katharina

Is there a way to find out the number of monitors? Something that returns something like:
1: Monitor A
2: Monitor B

Comment only
18 Oct 2014 WindowAPI Set figure size, top-most, transparency and pixel mask, multi-monitor etc by Windows API Author: Jan Simon

Jan Simon (view profile)

Tim

Tim (view profile)

With the change to figure handle objects in R2014b, one needs to get the integer figure handle to pass to WindowAPI for it to work with that version:
h = figure; % object handle
FigH = h.Number; % integer handle

5
17 Oct 2014 Limit figure size Set minimal or maximal size of a figure Author: Jan Simon

Jan Simon (view profile)

Dan

Dan (view profile)

Thanks for the script it has been very useful for me.

It seems, there is a small compability issue with 2014b and the new graphics system (HG2). To access the java frame correctly, after line 99 of your code you need to add another catch for HG2:
jClient = jFrame.fHG2Client;
(see here http://undocumentedmatlab.com/blog/hg2-update#observations)

Comment only
17 Oct 2014 Limit figure size Set minimal or maximal size of a figure Author: Jan Simon

Jan Simon (view profile)

Dan

Dan (view profile)

4
16 Oct 2014 FileTime Get and set the times for creation, access and modification of a file or folder (Windows only) Author: Jan Simon

Jan Simon (view profile)

Rusty Shackleford

Exactly what I needed. Let me emphasize to users that you must have the pre-compiled mex file!

5
13 Sep 2014 DataHash MD5 or SHA hash for array, struct, cell or file Author: Jan Simon

Jan Simon (view profile)

Giorgio

Well written!

5
21 Aug 2014 fRMField Remove a field from a struct efficiently - fast C-Mex Author: Jan Simon

Jan Simon (view profile)

Adam

Adam (view profile)

5
18 Aug 2014 BlockMean Mean of rectangular submatrices, fast C-Mex (no running mean) Author: Jan Simon

Jan Simon (view profile)

Jan Simon

Jan Simon (view profile)

@sykam varma: As far as I understand: Yes. Simply try it.

Comment only
15 Aug 2014 DateStr2Num Convert date string to date number - C-Mex: much faster than DATENUM Author: Jan Simon

Jan Simon (view profile)

Felipe

Felipe (view profile)

5
12 Aug 2014 BlockMean Mean of rectangular submatrices, fast C-Mex (no running mean) Author: Jan Simon

Jan Simon (view profile)

sykam varma

I want to do block averaging of matrix which is double ofrmat. Can I use this file?

Comment only
08 Aug 2014 FileRename Fast renaming of files or folders Author: Jan Simon

Jan Simon (view profile)

Lukas

Lukas (view profile)

Nice one, thank you!

5
02 Aug 2014 DateStr2Num Convert date string to date number - C-Mex: much faster than DATENUM Author: Jan Simon

Jan Simon (view profile)

Jan Simon

Jan Simon (view profile)

@joh: What exactly is an "array of dates"? Cell strings are handles internally already.

Comment only
30 Jul 2014 DateStr2Num Convert date string to date number - C-Mex: much faster than DATENUM Author: Jan Simon

Jan Simon (view profile)

joh

joh (view profile)

hi, would you use a for loop for an array of dates?

Comment only
17 Jul 2014 CalcMD5 Another MD5 calculator as fast C-Mex Author: Jan Simon

Jan Simon (view profile)

Egor

Egor (view profile)

Thanks, usefull tool!

5
09 Jul 2014 WindowAPI Set figure size, top-most, transparency and pixel mask, multi-monitor etc by Windows API Author: Jan Simon

Jan Simon (view profile)

Philip Ohnewein

5
09 Jul 2014 ScaleTime Fast linear interpolation of equally spaced data (C-MEX and M) Author: Jan Simon

Jan Simon (view profile)

Jan Simon

Jan Simon (view profile)

@Andrea: I do not know the meaning of your data and the contents of the variable "value". You could send me a running example to the email address found in the code.

Comment only
08 Jul 2014 ScaleTime Fast linear interpolation of equally spaced data (C-MEX and M) Author: Jan Simon

Jan Simon (view profile)

Andrea Bechi

Hi,
I'm trying to use your ScaleTime function to replace interp1 in my code.I am trying to interpolate data in this way:
"load('data.mat');
v = ScaleTime(data(:,2), data(1,1), data(4293,1), value);"

I do not understand my mistake. Error message is:

"Index exceeds matrix dimensions.

Error in ScaleTime (line 139)
Yi = Y(Ti, :) .* (1 - Si) + Y(Ti + 1, :) .* Si;"

Thank You in advvance for your time.

Comment only
06 Jul 2014 VChooseK Choose K elements from a vector - MEX: 100 times faster than NCHOOSEK Author: Jan Simon

Jan Simon (view profile)

Jan Simon

Jan Simon (view profile)

@Nitin Agrawal: No, there is no pure C-code. I meant, that you can use the MSVC2010 version to compile the C-mex function. Sorry.

Comment only
04 Jul 2014 DataHash MD5 or SHA hash for array, struct, cell or file Author: Jan Simon

Jan Simon (view profile)

José Crespo Barrios

5
03 Jul 2014 FileTime Get and set the times for creation, access and modification of a file or folder (Windows only) Author: Jan Simon

Jan Simon (view profile)

harun artuner

very usefull dll for me.
thanks alot.

5
30 Jun 2014 VChooseK Choose K elements from a vector - MEX: 100 times faster than NCHOOSEK Author: Jan Simon

Jan Simon (view profile)

Nitin Agrawal

@Jan. Thanks for your response. In your earlier reply dated 16 feb 2014, you said that the c-code can be compiled using MSV 2010 without any modifications. Is there a pure C version available with you? Could you upload it.

Comment only
29 Jun 2014 VChooseK Choose K elements from a vector - MEX: 100 times faster than NCHOOSEK Author: Jan Simon

Jan Simon (view profile)

Jan Simon

Jan Simon (view profile)

@Nitin Agrawal: mex.h belongs to Matlab. If you want to use the function in a C-environment, you neither need mex.h nor the gateway function mexFunction(). Some modifications are required, e.g. the functions for the errors and warnings. I'd suggest to start from the inc-file and implement one data type required for your problem only.

Comment only
29 Jun 2014 VChooseK Choose K elements from a vector - MEX: 100 times faster than NCHOOSEK Author: Jan Simon

Jan Simon (view profile)

Nitin Agrawal

Hi Jan

I wanted the use this code as a C function in one of my C programs, however when I try to compile this code in C (using gcc), headers file "MEX.h" is found to be missing by the compiler. It in turn required me to have "Pair.h" and "matrix.h", <vector> etc when I tried using a "MEX.h" header file which I found on the internet. Please advice.

5
26 Jun 2014 XSum Fast Sum with error compensation Author: Jan Simon

Jan Simon (view profile)

bmv

bmv (view profile)

@Jan Simon:
Release at first the simplest version of XCumSum for single and double data!

Comment only
20 Jun 2014 XSum Fast Sum with error compensation Author: Jan Simon

Jan Simon (view profile)

Jan Simon

Jan Simon (view profile)

@bmv: I've struggled a lot with a string comparison command, which does not depend on the platform.

This tool was developped for experiments. Obviously Knuth and Knuth2 are worth to be applied in productive code, so I think about a multi-threaded version for a fair speed.

I started to write an XCumSum also, but stuck on the decision, if it should offer saturated arithmetics for integer types also.

@Moshe: You find my email address in the help section of the code. The uppercase characters defend spam bots and must be replaced obviously.

Comment only
20 Jun 2014 MinMaxElem Min and max element and index - C-Mex faster than MIN/MAX Author: Jan Simon

Jan Simon (view profile)

Jan Simon

Jan Simon (view profile)

@Jim: It would be useful for me to receive your unit-test output by email. I guess, that the /fp:fast flag impedes the detection of NaN's?

This tool was faster for Matlab 2009a. But modern Matlab versions apply a better MAX algorithm and profit from multi-threading. Therefore only the 'finite' flag is a real benefit of this submission now and I will remove the "speed claims" from the documentation, until I add multi-threading also.

Thanks for your helpful comment.

Comment only
20 Jun 2014 MinMaxElem Min and max element and index - C-Mex faster than MIN/MAX Author: Jan Simon

Jan Simon (view profile)

Jim Hokanson

Jim Hokanson (view profile)

Hi Jan,

I'm using 64 bit 2014a with 4 processors (8 cores). Matlab uses multiple cores for min and max as seen in the Performance section of the Windows task manager. Also, with x64 SSE2 doesn't exist.

http://msdn.microsoft.com/en-us/library/vstudio/jj620901(v=vs.110).aspx

AVX provides a small speedup but sadly you really need multiple core code to compete.

Also, some of the unit tests fail now ... perhaps due to the fp:/fast flag.

Jim

Comment only
16 Jun 2014 XSum Fast Sum with error compensation Author: Jan Simon

Jan Simon (view profile)

bmv

bmv (view profile)

Is there fast Xcumsum version?

Comment only
16 Jun 2014 XSum Fast Sum with error compensation Author: Jan Simon

Jan Simon (view profile)

bmv

bmv (view profile)

Solved by:
// Case-insensitive string comparison depends on the compiler: -----------------
// strncmpi, strnicmp, _strnicmp, ...
#define STRCMP_NI _strnicmp

to

#define STRCMP_NI strncasecmp

Comment only
16 Jun 2014 XSum Fast Sum with error compensation Author: Jan Simon

Jan Simon (view profile)

bmv

bmv (view profile)

For Linux: x86_64
XSum
Error using InstallMex>error_L (line 249)
*** InstallMex: Unknown string or missing file: uTest_XSum
Error in InstallMex (line 93)
error_L('MissFile', 'Unknown string or missing file: %s', Arg);
Error in XSum (line 103)
Ok = InstallMex('XSum.c', 'uTest_XSum');

For:
Ok = InstallMex('XSum.c');
*** Compilation failed:
Error using mex
/tmp/mex_2309150000725708_22138/XSum.o: In function `mexFunction':
XSum.c:(.text+0xd80): undefined reference to `_strnicmp'
XSum.c:(.text+0xda2): undefined reference to `_strnicmp'
XSum.c:(.text+0xdc4): undefined reference to `_strnicmp'
XSum.c:(.text+0xde6): undefined reference to `_strnicmp'
XSum.c:(.text+0xe08): undefined reference to `_strnicmp'
/tmp/mex_2309150000725708_22138/XSum.o:XSum.c:(.text+0xe2a): more undefined references to `_strnicmp' follow

Comment only
16 Jun 2014 XSum Fast Sum with error compensation Author: Jan Simon

Jan Simon (view profile)

bmv

bmv (view profile)

5
16 Jun 2014 XSum Fast Sum with error compensation Author: Jan Simon

Jan Simon (view profile)

Moshe

Moshe (view profile)

5
16 Jun 2014 XSum Fast Sum with error compensation Author: Jan Simon

Jan Simon (view profile)

Moshe

Moshe (view profile)

I should add that without all these string comparisons, which evidently works slightly differently in the mac c compiler, this runs beautifully (if I just decide to stick with the default Knuth method and comment out the part determining the method).

Comment only
16 Jun 2014 XSum Fast Sum with error compensation Author: Jan Simon

Jan Simon (view profile)

Moshe

Moshe (view profile)

Thanks for the response, and for putting together a useful utility in the first place. I don't have your email address so let me try one more comment here. When I compile the new version, I get a single error message this time (I have the standard C compiler that comes with X-code, I can also install the Intel compiler if needed).

warning: implicit declaration of function '_strnicmp' is invalid in C99 [-Wimplicit-function-declaration]
if (STRCMP_NI(Method_In, "Knuth", Method_LEN) == 0)

Thanks!

Moshe

Comment only
15 Jun 2014 XSum Fast Sum with error compensation Author: Jan Simon

Jan Simon (view profile)

Jan Simon

Jan Simon (view profile)

@Moshe: The problems you observe depend on the compiler of the Mac. Please try the new version when it appears in the next days. In case of further problems, send me an email.

Comment only

Contact us