Is there any way to read MATLAB's .mat files in Perl?
문제
I have some data generated in MATLAB that I want to process using Perl. I saved the data from MATLAB in a .mat file. Is there any way to read it in Perl?
해결책
One option would be to save the binary MAT file as ASCII from inside MATLAB using something like:
load('test_data.mat');
save('test_data.asc', 'var1', 'var2', '-ascii');
Then you would have ASCII data to process in Perl.
If you need a solution completely written in Perl, then you should be able to automate the process using the Math::MATLAB package on CPAN.
NOTE: If Python is an option, you could use the loadmat
function in the SciPy Python library.
다른 팁
The Java library JMatIO has worked well for me. Maybe you can try using inline Java.
제휴하지 않습니다 StackOverflow