How to quickly save large variable, which will increase its length by time?

3 views (last 30 days)
Hi, iam using serial pulling of data from device. Iam transmitting a code to serial device and it gives data (time taken : 0.17 sec) again i have to send the code for every 0.3 sec and receive the data. So i have 0.13 sec to save the variable. when the variable length is more (reaches 133000 X 3)(increases by 1x3,2x3,nx3), it is taking 0.15 sec so the time is exceeding 0.3 sec and the serial device gives me error. So i need to save the variable quickly and continuously. fast saving of variable or parallel saving of variable without distrubing the pulling
  4 Comments
Stephen23
Stephen23 on 8 Feb 2017
@johnphilip bhimavarapu: do you mean that you have lots of computer memory (RAM), or lots of hard drive space? These are two totally different things. For limits on memory used by MATLAB, see:
Walter Roberson
Walter Roberson on 8 Feb 2017
You read the data from the serial line, and then what has to be done with it? Is it just immediately plotted? Are you writing it to hard drive?
288000 X 6 ... I am not clear on the time frame that arrives in?
You mentioned 133000 X 3 double and implied that could come through in 0.17 seconds. You do not mention format, but you mention serial.
If it is text format, then double needs 21 characters to fully represent, plus a 1 character delimiter between fields (or at end of line), which would get you to 8778000 characters in 0.17 seconds. I calculate that would require that the serial port run at over 500 megabits per second. 8 byte double instead of text would need about 188 megabits per second. MATLAB's serial routines cannot handle those rates. Possibly the Data Acquisition Toolbox could handle that with a good card, but that would not be serial (more like PCIe doing DMA.)

Sign in to comment.

Answers (0)

Categories

Find more on Signal Integrity Kits for Industry Standards in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!