Rank: 3318 based on 43 downloads (last 30 days) and 3 files submitted
photo

Andreas Sprenger

E-mail
Company/University
University Luebeck/Germany

Personal Profile:
Professional Interests:
Psychophysiology, electrophysiology

 

Watch this Author's files

 

Files Posted by Andreas View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
31 Mar 2014 GenerateDOSfilename Generates a unique string with 8 characters Author: Andreas Sprenger dos, filename, eyelink 9 2
  • 4.0
4.0 | 1 rating
11 Feb 2011 IsPath Checks for and displays user specific path definitions Author: Andreas Sprenger path tools 9 5
  • 3.5
3.5 | 2 ratings
13 Feb 2006 xlswrite Write matrices to MS Excel file. Author: Andreas Sprenger data import, data export, excel export, write matrices, utilities, data 25 9
  • 3.8
3.8 | 10 ratings
Comments and Ratings by Andreas
Updated File Comments Rating
27 Nov 2008 Custom 2D Gauss Generates a customized 2D gauss Author: Thomas Dideriksen

Great, very flexible, just what we want to have. THX

Comments and Ratings on Andreas' Files View all
Updated File Comment by Comments Rating
21 May 2014 xlswrite Write matrices to MS Excel file. Author: Andreas Sprenger Booker, John

28 Feb 2014 GenerateDOSfilename Generates a unique string with 8 characters Author: Andreas Sprenger David

It's a great idea, but there's a typo. The minutes "Mn" obviously goes up to 59, which will give an error when trying to index the length-36 array. Replacing the last line with:

varargout = {[abc([Y-2000, M, D, H]) [num2str(Mn) num2str(round(S))]]};

should work better.

I'd also doubt that DOS will be gone by 2036, if it has hung on this long. There are 36^8 = 2.82e12 possible 8-character filenames, which should be enough for over 89000 years at a rate of one per second. We could use the date number function, and convert the result to base 36, to achieve this. You could try something like:

% Not rigorously tested!
abc = '0123456789abcdefghijklmnopqrstuvwxyz';
dnum = round(now*24*60*60); % Serial date number, with seconds as the whole number.
% now = datenum(now)
%
varargout = {abc(base36(dnum))};
%
function out = base36(in)
out = zeros(1,8);
for itO = 8:-1:1
out(itO) = mod(in, 36)+1;
in = floor(in/36);
end
end
%
end

which is admittedly a lot less elegant than yours, but will avoid that dreaded Y2036 bug!

28 Feb 2014 GenerateDOSfilename Generates a unique string with 8 characters Author: Andreas Sprenger Jos (10584)

Nice idea, although I will stick with my own version

filename = [datestr(now,'ddHHmmss') '.ext']

And shall we make a bet that DOS still is used in 2034?

28 Mar 2012 IsPath Checks for and displays user specific path definitions Author: Andreas Sprenger Ben

Thanks! Saved me from having to write this myself!

28 Mar 2012 IsPath Checks for and displays user specific path definitions Author: Andreas Sprenger Ben

Contact us