hi every one. i want to log some data bus in chip_scope and import this data to matlab.
with ascii exporting data bus, chip_scope gives txt file like this
how can i take this hex datas from txt file with matlab and convert it to integer?
thanks:?:
Just write a script in your fav scripting language (Bash, Perl, Python) which will read the txt file you have posted and write out the desired file to be read by MAtlab.
Just write a script in your fav scripting language (Bash, Perl, Python) which will read the txt file you have posted and write out the desired file to be read by MAtlab.
You could just write the script in MATLAB; why bother bringing another tool into the mess? Just use fopen and fgetl to read each line. You'll have to parse the line depending on your data. For your case it looks like you just need to extract the third element and stick it into an array which you play with after all the lines have been read in. Something like:
Code:
while 1
line=fgetl(fileid);
if ~ischar(line),break,end;
c=strsplit(line);
data=eval(char(c(3)));
d_array(index)=data;
index+1;
end