How do I convert files on my workspace to mat file ??
    3 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Chidiebere Ike
 el 5 de Abr. de 2018
  
    
    
    
    
    Respondida: Walter Roberson
      
      
 el 5 de Abr. de 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 comentarios
Respuesta aceptada
  Walter Roberson
      
      
 el 5 de Abr. de 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 comentarios
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

