0

I have .txt file created by an STM32 connected to a accelerometer sensors. This file are Ascii file (probabily 8bit)

I tried to visualize on Matlab using

 ZZ = load('000_LOG.TXT', '-ascii')
 Error using load
 Unknown text on line number 1 of ASCII file 000_LOG.TXT

so i tried

 zx = load ('000_LOG.TXT')
 Error using load
 Unknown text on line number 1 of ASCII file 000_LOG.TXT

so i tried after reading this post importing ASCII file to Matlab

  fid = fopen ('000_LOG.TXT');
  >> myData = fread ('fid') 
  Error using fread
  Invalid file identifier. Use fopen to generate a
  valid file identifier.

The command "importdata" worked, but i can't convert to dec

  Xw = importdata ('000_LOG.TXT')

  Xw = 

             '|}}|}}|~}|~}|~}|}~|}~}}~}}~}}}}}~}}~}}|}}}}|}|}}~}}}}}}}|€}|}|€}}€}|...'

In fact

 Wx = bin2dec(Xw) 
 Error using bin2dec (line 35)
 Binary string must be 52 bits or less.

This is the link to the file .txt on dropbox https://www.dropbox.com/l/s/mDoDk5puIpZaEdLth4w0Lr

Thanks for your support

Community
  • 1
  • 1
Andrea Ciufo
  • 359
  • 1
  • 3
  • 19
  • 2
    Your use of `fread('fid')` is wrong... it should be `fread(fid)`. Also the text file is written in ASCII and after those sets of characters, it looks like each triple of characters is an 8-bit digit. Because you didn't write this as a binary file, this is going to be even more difficult to parse. You'll have to read in the raw text then write code to convert each triple of characters into their equivalent decimal representation. I think you should go back to the documentation of your accelerometer and figure out how the data is being outputted, then come back and ask a question. – rayryeng May 09 '16 at 16:17
  • @rayryeng i am an idiot. I corrected the error that you noticed and the problem was solved. Now I can visualize and plot my data. Thanks for all. – Andrea Ciufo May 10 '16 at 14:11

0 Answers0