Change the file from .mat to .txt

How can I convert a .mat file into a .txt file with all the headers? I do not know how many fields are present.

How do I export this data? I have MATLAB.

I tried in MATLAB:

load('test_data.mat');
save('test_data.txt', '-ascii'); 

It did not work.

0

1 Answer

If you are using MATLAB you can simply execute the command

load 'file.mat'

which will load all the variables in the .mat file into your workspace. You can then do something like:

save('newfile.txt', 'var1, 'var2', ..., '-ascii')

to save the variables you specify into an ASCII file. The save() function has a lot of arguments and options, check the documentation.

And if you are not using MATLAB your question doesn't make much sense to me.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like