How do I convert files on my workspace to mat file ??
2 views (last 30 days)
Show older comments
Chidiebere Ike
on 5 Apr 2018
Answered: Walter Roberson
on 5 Apr 2018
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
0 Comments
Accepted Answer
Walter Roberson
on 5 Apr 2018
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 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!