How do I convert files on my workspace to mat file ??

2 次查看(过去 30 天)
I have a file on my workspace named effLBP containing extracted feature It's a 592*896*3uint8 matrix
1. How do I convert this file to .mat file ??
2.How do I convert the .mat file to csv or arff file format?
Please help.
Thanks

采纳的回答

Walter Roberson
Walter Roberson 2018-4-5
To load the uint8 data you need to know what order it was written in. The basic setup is
fid = fopen('effLBP.dat', 'r');
data = fread(fid, 592*896*3, '*uint8');
fclose(fid);
After that you have to start re-arranging the data until it makes sense, such as
data123 = reshape(data, 592, 896, 3);
data213 = permute(reshape(data, 896, 592, 3), [2 1 3]);
data132 = permute(reshape(data, 592, 3, 896), [1 3 2]);
data321 = permute(reshape(data, 3, 896, 592), [3 2 1]);
and see which one looks right when you image() it.

更多回答(0 个)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by