Rank: 1242 based on 107 downloads (last 30 days) and 5 files submitted
photo

Tim

E-mail
Company/University
Imperial College

Personal Profile:

 

Watch this Author's files

 

Files Posted by Tim View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
16 Dec 2010 Serialize/Deserialize Encode and decode almost any matlab variable into a sequence of bytes. Author: Tim serialize, encode, save, data, matfile, network 22 9
  • 4.33333
4.3 | 6 ratings
23 Apr 2010 C++ class to write HDF5 .mat files. This is a small C++ class that lets you write matrices, vectors and values to a .mat file. Author: Tim hdf5, mat, save, c, format, write 8 4
11 Feb 2010 1D Fourier shift Shift 1D signals using the Fourier shift theorem. Author: Tim signal processing, fourier, shift, interpolation, rotate, delay 13 1
  • 5.0
5.0 | 2 ratings
11 Feb 2010 2D Fourier shift Cyclically shift a 2D matrix or image using the Fourier shift theorem. Author: Tim image, shift, fourier, rotate, sinc, 2d 16 2
  • 5.0
5.0 | 5 ratings
24 Mar 2009 WriteToVTK Write 3D matrices to VTK files viewable with Paraview. Author: Tim vtk, paraview, visualisation, export, save, 3d 48 5
  • 4.33333
4.3 | 3 ratings
Comments and Ratings by Tim View all
Updated File Comments Rating
22 May 2012 C++ class to write HDF5 .mat files. This is a small C++ class that lets you write matrices, vectors and values to a .mat file. Author: Tim

It definitely linked fine when I wrote it! Can you post the errors you get, and how you are building it?

31 Oct 2011 Serialize/Deserialize Encode and decode almost any matlab variable into a sequence of bytes. Author: Tim

Hakon: You mean so you can send entire functions? That would be difficult, but check out func2str() and functions().

16 Dec 2010 Trans Camera View This .m function transforms camera captured image to planner plane using perspective transformation. Author: Nobuhito Mori

The .m files are 0-byte files.

24 Nov 2009 LeCroy Oscilloscopes - MATLAB Instrument Driver MATLAB instrument driver for LeCroy oscilloscopes such as SDA, WaveMaster, WavePro, and WaveRunner Author: The Instrument Control Team

Works most of the time, but theres *no* documentation, and I get a lot of random timeouts and errors. And there are a *lot* of different errors. I've seen at least the following:

"non-existent field 'wd'"
"no appriopriate method property of field supportOutput for class"
Something about string formatting (wtf?)
Something about the header not being 8 bytes long.
Generic timeouts - didn't receive any data. This also happens when connecting a lot.

In all cases the solution is to disconnect and try again. Buggy doesn't begin to describe it...

Comments and Ratings on Tim 's Files View all
Updated File Comment by Comments Rating
12 Jun 2014 Serialize/Deserialize Encode and decode almost any matlab variable into a sequence of bytes. Author: Tim Sebastian

I found the following problems with your functions:
1. fieldless structures like "struct()" and logicals like "false" throw an error (already mentioned)
2. Empty structures (even with fields) result in an empty array
3. Data types other than double are always returned as double, even if the class seems to be serialized

08 May 2014 Serialize/Deserialize Encode and decode almost any matlab variable into a sequence of bytes. Author: Tim Ralph Coleman

In deserialize_object, you should distinguish between graphical handles and handles to objects defined with classdef. I modified the code in the following way to get it to work:
if ishandle(v)
set(v,fn{1},conts.(fn{1}));
else
v.(fn{1}) = conts.(fn{1});
end

30 Mar 2014 WriteToVTK Write 3D matrices to VTK files viewable with Paraview. Author: Tim Florian de vuyst

Top !

05 Mar 2014 WriteToVTK Write 3D matrices to VTK files viewable with Paraview. Author: Tim Octopode

Actually, i just modified the file to be more general to scalar data, using signed, floating points. No need to normalize, no need to have positive values :

For that, one can simply change " SCALARS blah char "
to "SCALARS blah float".
Then instead of :
fwrite(fid, num2str(v'));

use, for instance with a precision of 3 digits :
fprintf(fid,'%1.3f\040',v);

which will add only one blank space between each value whether it is positive or negative. (fwrite would actually add 2 blanks if the value is positive, fprintf understands the \040 ascii code as it's supposed to).

So, finally, we'd have :

fwrite(fid, ['# vtk DataFile Version 2.0' nl 'Volume example' nl 'ASCII' nl ...
'DATASET STRUCTURED_POINTS' nl 'DIMENSIONS ' ...
num2str(N) ' ' num2str(M) ' ' num2str(O) nl 'ASPECT_RATIO 1 1 1' nl ...
'ORIGIN 0 0 0' nl 'POINT_DATA ' ...
num2str(N*M*O) nl 'SCALARS matlab_scalars float 1' nl 'LOOKUP_TABLE default' nl]);

for z = 1:O
% Get this layer.
v = matrix(:, :, z)';
% Scale it. This assumes there are no negative numbers. I'm not sure
% this is actually necessary.
v = v(:)';
% Write the values as text numbers.
fprintf(fid,'%1.3f\040',v);
% Newline.
fwrite(fid, nl);

end

Tested with Paraview 4.1. Worked like charm.

05 Mar 2014 WriteToVTK Write 3D matrices to VTK files viewable with Paraview. Author: Tim Octopode

According to your code, one should be careful as for the X and Y dimension. VTK structured data have x coordinates increasing faster, then y, and z.
By doing v = matrix(:, :, z);, the Y coordinates (rows) increase faster. Thus the VTK reader will assimilate the rows as the X dimension. So unless we transpose the matrix before sending it to writeToVTK, the VTK reader (paraview) will show us a transposed version of our arrays, X/Y -> Y/X. Am i correct ?

Contact us