ArcView (ArcGIS) AVL file format to Matlab mat file format - matlab

I have a file that is in AVL file format from a program called ArcGIS (formerly ArcView) that I need to convert to a mat file. It contains data I need to play back. Can anybody suggest a simple way to convert the file? I have done quite a bit of searching, and it seems the AVL is not a binary, aka it is a text format, which means I could write a program to convert it, but only if I also knew the corresponding matlab MAT file format. Moreover, this could take quite a while to do, and I need to file to be converted quickly so I can use the data.

Related

How to save features into .mat file and .txt file using python in keras?

I would like to save my predicted features into .mat format and .txt format in keras for further process in Matlab. Please help me. Thanks.
For .mat, check out SciPy's File IO.
For .txt, there are many options, such as NumPy's savetxt.
Check out the CSV format as well, which is a common way to save data for cross-platform use.

ILNumerics unable to read mat file of -v7 format

I know ILNumerics handles mat file saved using -v6 or -v7.3 option quite nicely but anyone knows how to make it recognize files saved using -v7 option?
The -v7 option by default uses compression and hence ILNumerics will give me a message saying it does not support compressed file and suggests me using -v6 option to save the file.
I guess nowdays mat file saved using latest releases of matlab (like 2010 - 2014) prefer the -v7 file format against the -v7.3 format which internally uses HDF5 because of the overhead HDF5 causeds. And since compression it's also smaller in size than the -v6 file which also is a big advantage.
So can ILNumerics fill this gap? Or is there already a solution that I missed?
Thanks.

Compression of large figures in .fig format in MATLAB

My MATLAB script generates a figure from a timeseries data that, when saved, is over 200 MB in size. Is there a way to compress the figure to a lesser size in '*.fig' format? The compression has to be lossless so that I can zoom in and view the details in the figure. The figure has to be saved in *.fig format so that the axis property relations between subplots are preserved and I can use the data cursor tool.
The *.fig format cannot be saved as is in compressed form. The format is just not capable of it. But in MATLAB you can use functions zip to compress files created by savefig, and unzip with passing to openfig. This way you can create simple script to load and save zipped figs. Of course you will need to use a temp file, which should be taken care of as well.

Read and represent mp3 files using memmapfile in matlab

I have to analyze bio acoustic audiofiles using matlab. Eventually I want to be able to find anomalies in the audio. That's the reason I need to find a way to represent the audio in a way I can extract and compare features. I'm dealing with mp3 files up to 150 mb. These files are too large for matlab to read in to it's memory. Therefore I want to use the memmapfile() function. I used the following code and a small mp3 file to find out how it actually works.
[testR, ~] = audioread('test.mp3');
testM = memmapfile('test.mp3');
disp(testM.Data);
disp(testR);
The actual values of the testM.Data and testR are different. Audioread() returns a 7483391 x 2 matrix and memmapfile() a 4113874 x 1 matrix.
I'm not really sure how memmapfile() works, I expected this to be equal to each other. Is there a way to read mp3 files in the same format audioread() does using memmapfile()? And what does memmapfile actually return in case of an audio file? Maybe it's also usable in the vector format in the case of anomaly detection?
Thanks in advance!
NOTE: The original files were in wav IMA ADPCM format with sizes from 1.5 up to 2.5 gb. Since Matlab can't deal with that format and the size of the files I converted them to 8bit mp3 files.
I think that the problem is mammapfile by default read data in uint8 format, while audioread function read data in another way.
How you can see here you can specify the format of data when you read it with memmapfile, so try to "play" with different values. From the documentation I read that you can read data in double format, so try to modify the memmapfile data format and audioread data format.
Last thing, memmapfile always organize the data in matrix like "somenumbers x 1", so if you want the original one you need to use something like reshape.
Anyway if you work with big data I suggest you to try with something different instead memmapfile, because it is very very slow

Convert image to png byte array in Matlab

I would like to take a 512x512 image and convert it into a png byte array in Matlab so that I can stream it via a socket.
At the moment I take the array, write it to a png file using imwrite(I,'file.png'), then read it as a binary file and send it through the socket. This is obviously horribly inefficient because I first write to disk and then read from disk. I want to skip the and write to disk.
Is there anyway to do this in Matlab?
Probably not directly using the base MATLAB toolbox since the PNG file itself is created by the PNGWRITEC MEX-function. However, there may be some Java classes that can help, such as those in the javax.imageio package.