Rank: 340122 based on 0 downloads (last 30 days) and 0 file submitted
photo

Nath

E-mail

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Comments and Ratings by Nath View all
Updated File Comments Rating
13 Feb 2013 DataHash MD5 or SHA hash for array, struct, cell or file Author: Jan Simon

function handle refering to struct containing the function will create infinite loop. Is there any workaround ?

Exemple:

d= dynamicprops();
addprop(d,'f');
d.f= @(varargin) struct2cell(d);
DataHash(d.f) % infinite loop

13 Feb 2013 Serialize/Deserialize Encode and decode almost any matlab variable into a sequence of bytes. Author: Tim

typecastx would give better perf than typecast.
It is also possible to avoid a few loops. I tested this and it runs faster (modify the serializeCell subfunction)
% Dimensions.
% for ii = 1:ndims(v)
% m = [m; typecastx(uint32(size(v, ii)), 'uint8').'];
% end
m = [m; typecastx(uint32(size(v)), 'uint8').'];

% Just serialize each member.
% for ii = 1:numel(v)
% m = [m; serialize(v{ii})];
% end
m0= cellfun(@serialize,v(:),'uni',0);
m= cat(1,m,m0{:});

Contact us