Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
How to input a large data file in Simulink?

Subject: How to input a large data file in Simulink?

From: fl

Date: 19 Mar, 2013 18:39:13

Message: 1 of 2

Hi,
I have a large quantity of sampling data which is about 500 MB. The data format is shown as below. I would use these data in Simulink. Each time step will read one row of data. I would like to know what block/function is a best way to read one row for each time step.

The concerns are as following:
1. The first 35 rows (This number is determined, no change for each file) should be bypassed (neglected);
2. The input data file extension is .csv

3. textscan seems useful for large input data file, but I have no idea about how to use it in Simulink.

Thanks,


.........
Serial No,tw52270524
AnalogTriggerCondixxxn,Aboxxxxxxxxvel
AnalogTriggerSource,ExxxxxxxxxxxxxPin
BurstModeEnabled,True
DelayTriggerCount,0
DigitalTrxxxxxxxxarity,PositiveEdge
ExternalReferencexxxxxxxxx,10000
SamplingRate,1000
Signalxxxxxxxxxxxx,None
SingleShotSampleSize,500
Timebase,Internal
TriggerHighThreshold,1.1
TriggerLowThreshold,0
TriggerPosition,Post
TriggerSource,Software
Time Per Point,0.001
XLabel,Time (s)
YLabel,V

Mode,Continuous
Channel,1,2
Channel Name,Channel 1,Channel 2
Measurement Unit,V,V
SignalType,RSE,RSE
Polarity,Bipolar,Bipolar
Range,10,10
Averaging,Disable,Disable

0,-0.00701904296875,0.2716064453125
1,-0.00579833984375,0.17578125
2,-0.0054931640625,0.11383056640625
3,-0.0054931640625,0.07354736328125
4,-0.00518798828125,0.047607421875

Subject: How to input a large data file in Simulink?

From: anyone

Date: 19 Mar, 2013 19:22:36

Message: 2 of 2

On Tue, 19 Mar 2013 11:39:13 -0700, fl wrote:

> Hi,
> I have a large quantity of sampling data which is about 500 MB. The data
> format is shown as below. I would use these data in Simulink. Each time
> step will read one row of data. I would like to know what block/function
> is a best way to read one row for each time step.
>
> The concerns are as following:
> 1. The first 35 rows (This number is determined, no change for each
> file) should be bypassed (neglected);
> 2. The input data file extension is .csv
>
> 3. textscan seems useful for large input data file, but I have no idea
> about how to use it in Simulink.

AFIK, Simulink doesn't have a canned routine for parsing file headers. Seems likely you'll need to pre-process that
manually, or try one of the following from the library:

"From Workspace"
"user-defined function"

There may be a way to invoke "Import", but you'll need to do a bit of your own research. Apart from that -- try to
build your own S-function-based library model; strip-out the time vector and pass the data vector directly to your
Simulink model.
[...]

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us