Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

Import chipscopes data to matlab

Status
Not open for further replies.

amin5659

Member level 3
Joined
Mar 28, 2015
Messages
55
Helped
1
Reputation
2
Reaction score
1
Trophy points
8
Activity points
521
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
Capturesdfsd.PNG
how can i take this hex datas from txt file with matlab and convert it to integer?
thanks:?:
 

amin5659

Member level 3
Joined
Mar 28, 2015
Messages
55
Helped
1
Reputation
2
Reaction score
1
Trophy points
8
Activity points
521
thanks. how can i just import this hex data to MATLAB.? as you see there is sample window and sample buffer which i have to ignore. i dont know how...
 

dpaul

Advanced Member level 4
Joined
Jan 16, 2008
Messages
1,356
Helped
289
Reputation
578
Reaction score
283
Trophy points
1,373
Location
Germany
Activity points
10,334
how can i just import this hex data to MATLAB.? as you see there is sample window and sample buffer which i have to ignore.
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.
 

barry

Advanced Member level 5
Joined
Mar 31, 2005
Messages
4,834
Helped
1,065
Reputation
2,140
Reaction score
1,049
Trophy points
1,393
Location
California, USA
Activity points
26,363
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
 

dpaul

Advanced Member level 4
Joined
Jan 16, 2008
Messages
1,356
Helped
289
Reputation
578
Reaction score
283
Trophy points
1,373
Location
Germany
Activity points
10,334
You could just write the script in MATLAB; why bother bringing another tool into the mess?
I don't use Matlab!
So I jst gave the basic idea of using scripts. Now if it can be done in Matlab, good for the OP.
 

barry

Advanced Member level 5
Joined
Mar 31, 2005
Messages
4,834
Helped
1,065
Reputation
2,140
Reaction score
1,049
Trophy points
1,393
Location
California, USA
Activity points
26,363
I don't use Matlab!
So I jst gave the basic idea of using scripts. Now if it can be done in Matlab, good for the OP.
The question was “how to import into matlab”. You answered a totally different question.
 

dpaul

Advanced Member level 4
Joined
Jan 16, 2008
Messages
1,356
Helped
289
Reputation
578
Reaction score
283
Trophy points
1,373
Location
Germany
Activity points
10,334
Sorry, my bad......didn't read #1 thoroughly.
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search


Welcome to EDABoard.com

Sponsor

Sponsor

Design Fast


×
Top